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