#include <bits/stdc++.h>
using namespace std;
int main() {
  long long v;
  cin >> v;
  if (v > 2)
    cout << "2" << endl;
  else
    cout << "1" << endl;
  for (int i = 2; i <= v + 1; i++) {
    int ans = 0;
    for (int j = 2; j * j <= i; j++) {
      if (i % j == 0) ans++;
    }
    if (ans > 0)
      cout << "2"
           << " ";
    else
      cout << "1"
           << " ";
  }
  return 0;
}
