#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
const int N = 1e6 + 7, mod = 1000000007, M = 2e9;
const long long MAX = 5e18;
int n;
bool p[N];
int main() {
  cin >> n;
  for (long long i = 2; i < N; i++) {
    if (!p[i]) {
      for (long long j = i * i; j < N; j += i) p[j] = 1;
    }
  }
  cout << (n < 3 ? 1 : 2) << '\n';
  for (int i = 2; i <= n + 1; i++) cout << p[i] + 1 << ' ';
  return 0;
}
