#include <bits/stdc++.h>
using namespace std;
int a[10000005] = {0}, ans = 0;
int main() {
  int n;
  cin >> n;
  if (n > 2)
    cout << 2 << endl;
  else
    cout << 1 << endl;
  for (int i = 2; i <= n + 1; i++)
    if (a[i] == 0)
      for (int j = 2 * i; j <= n + 1; j += i) a[j] = 1;
  for (int i = 2; i <= n + 1; i++) cout << a[i] + 1 << " ";
}
