#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int a[N];
pair<string, string> p;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, s;
  cin >> n;
  for (int i = 2; i <= n + 1; i++) {
    s = sqrt(i);
    for (int j = 2; j <= s; j++) {
      if (i % j == 0) {
        a[i] = 2;
      }
    }
    if (a[i] != 2) a[i] = 1;
  }
  if (n > 2)
    cout << 2 << endl;
  else
    cout << 1 << endl;
  for (int i = 2; i <= n + 1; i++) cout << a[i] << " ";
  return 0;
}
