#include <bits/stdc++.h>
using namespace std;
bool sieve[100005];
void sift(int N) {
  for (int i = 2; i <= N; i++) {
    if (!sieve[i]) {
      for (int j = 2 * i; j <= N; j += i) {
        sieve[j] = true;
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  int N;
  cin >> N;
  sift(N + 1);
  if (N >= 3) {
    cout << 2 << endl;
  } else
    cout << 1 << endl;
  for (int i = 0; i < N; i++) {
    cout << (int)sieve[i + 2] + 1 << " ";
  }
  cout << endl;
}
