#include <bits/stdc++.h>
using namespace std;
int n, a[100010], maxx = 1;
int main() {
  cin >> n;
  for (int i = 2; i <= n + 1; i++) a[i] = 1;
  for (int i = 2; i * i <= n + 1; i++)
    if (a[i] == 1)
      for (int j = 2; i * j <= n + 1; j++)
        if (a[i] == a[i * j]) {
          a[i * j]++;
          maxx = max(maxx, a[i * j]);
        }
  cout << maxx << '\n';
  for (int i = 2; i <= n + 1; i++) cout << a[i] << ' ';
}
