#include <bits/stdc++.h>
using namespace std;
int prime[100005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  prime[2] = 0;
  for (int i = 2; i <= n + 1; i++) {
    if (!prime[i]) {
      for (int j = 2 * i; j <= n + 1; j += i) {
        prime[j] = 1;
      }
    }
  }
  if (n > 2)
    cout << 2 << endl;
  else
    cout << 1 << endl;
  for (int i = 2; i <= n + 1; i++) {
    if (!prime[i])
      cout << 1 << " ";
    else
      cout << 2 << " ";
  }
}
