#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long int n;
  cin >> n;
  bool prime[n + 2];
  memset(prime, true, sizeof(prime));
  long long int m = 1, u = 2;
  prime[2] = true;
  long long int res[n + 2];
  for (long long int i = 2; i * i < n + 2; i++) {
    if (prime[i] == true) {
      for (long long int j = i * i; j < n + 2; j += i) {
        prime[j] = false;
      }
    }
  }
  if (n > 2) {
    cout << 2 << endl;
  } else
    cout << 1 << endl;
  for (long long int i = 2; i < n + 2; i++) {
    if (prime[i] == true)
      cout << 1 << " ";
    else
      cout << 2 << " ";
  }
  return 0;
}
