#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 10;
int color[maxn];
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  int c = 1;
  for (int i = 2; i <= n + 1; ++i)
    if (!color[i]) {
      color[i] = 1;
      for (int j = i * 2; j <= n + 1; j += i) {
        color[j] = 2;
      }
    }
  if (n == 1 || n == 2) {
    cout << 1 << endl;
  } else {
    cout << 2 << endl;
  }
  for (int i = 2; i <= n + 1; ++i) {
    if (i != 2) cout << ' ';
    cout << color[i];
  }
  cout << endl;
  return 0;
}
