#include <bits/stdc++.h>
using namespace std;
const int N = 100100;
int n, mx = 0;
int prime[N];
void seive() {
  for (int i = 2; i < N; i++) prime[i] = 1;
  for (int i = 2; i * i < N; i++)
    if (prime[i]) {
      for (int j = i * i; j < N; j += i) {
        prime[j] = 2;
      }
    }
}
int main() {
  cin >> n;
  seive();
  for (int i = 2; i <= n + 1; i++) {
    if (prime[i] > mx) mx = prime[i];
  }
  cout << mx << endl;
  cout << prime[2];
  for (int i = 3; i <= n + 1; i++) cout << " " << prime[i];
  cout << endl;
}
