#include <bits/stdc++.h>
using namespace std;
int p[1000002];
void solve() {
  int n;
  cin >> n;
  for (int i = 2; i <= n + 1; i++) {
    if (p[i] == 0) {
      for (int j = 2 * i; j <= n + 1; j += i) {
        p[j] = 1;
      }
    }
  }
  if (n > 2) {
    cout << "2"
         << "\n";
  } else {
    cout << "1"
         << "\n";
  }
  for (int i = 2; i <= n + 1; i++) {
    if (p[i] == 0) {
      cout << "1 ";
    } else {
      cout << "2 ";
    }
  }
}
int main() {
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
