#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> s(n + 2, 0);
  for (int i = 2; i <= n + 1; i++) {
    if (s[i] == 0) {
      for (int j = i + i; j <= n + 1; j += i) {
        if (s[j] == 0) {
          s[j] = 2;
        }
      }
    }
  }
  cout << (n > 2 ? 2 : 1) << endl;
  for (int i = 2; i <= n + 1; i++) cout << (s[i] == 0 ? 1 : s[i]) << " ";
  return 0;
}
