#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  n = n + 1;
  bool prime[n + 1];
  bool flag = false;
  memset(prime, false, sizeof(prime));
  for (int i = 2; i * i <= n; i++) {
    if (!prime[i]) {
      for (int j = i * i; j <= n; j += i) {
        prime[j] = true;
        flag = true;
      }
    }
  }
  cout << (flag ? 2 : 1) << "\n";
  for (int i = 2; i <= n; i++) {
    if (!prime[i])
      cout << 1 << " ";
    else
      cout << 2 << " ";
  }
}
