#include <bits/stdc++.h>
using namespace std;
const int N6 = 1e6 + 6, N3 = 1e3 + 6, oo = 1e9 + 9, base = 1e9 + 7;
const long long ool = 1e18 + 9;
long long n, u[N6], mx;
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (long long i = 2; i <= n + 1; ++i) {
    if (u[i]) continue;
    long long cnt = 1;
    u[i] = 1;
    for (long long j = 1ll * i * i; j <= n + 1; j += i) {
      if (cnt == 1) cnt = 2;
      u[j] = cnt;
    }
    mx = max(mx, cnt);
  }
  cout << mx << "\n";
  for (long long i = 2; i <= n + 1; ++i) {
    cout << u[i] << " ";
  }
  cout << "\n";
  return 0;
}
