#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
const int maxn = 200005;
const int mod = 1000000007;
long long chek[maxn];
bool checkprime[maxn + 5];
vector<long long> prime;
void sieve() {
  fill(checkprime, checkprime + maxn + 5, 1);
  prime.push_back(2);
  checkprime[0] = 0;
  checkprime[1] = 0;
  for (long long i = 4; i <= maxn; i += 2) checkprime[i] = 0;
  for (long long i = 3; i <= maxn; i += 2) {
    if (checkprime[i]) {
      prime.push_back(i);
      for (long long j = i * i; j <= maxn; j += (i + i)) checkprime[j] = 0;
    }
  }
}
void task() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << 1 << "\n" << 1 << "\n";
  } else if (n == 2) {
    cout << 1 << "\n";
    cout << 1 << ' ' << 1 << "\n";
  } else if (n == 3) {
    cout << 2 << "\n";
    cout << "1 1 2"
         << "\n";
  } else {
    cout << 2 << "\n";
    n++;
    for (int i = 2; i <= n; i++) {
      if (!checkprime[i])
        cout << 1 << ' ';
      else
        cout << 2 << ' ';
    }
    cout << "\n";
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  sieve();
  int T = 1;
  for (int __ = 1; __ <= T; __++) {
    task();
  }
  return 0;
}
