#include <bits/stdc++.h>
using namespace std;
typedef vector<long long int> vl;
void SieveOfEratosthenes(int n) {
  bool prime[n + 1];
  memset(prime, true, sizeof(prime));
  int c = 1;
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (int i = p * 2; i <= n; i += p) {
        c++;
        prime[i] = false;
      }
    }
  }
  if (c > 1)
    cout << "2" << endl;
  else
    cout << "1" << endl;
  for (int p = 2; p <= n; p++)
    if (prime[p])
      cout << "1"
           << " ";
    else
      cout << "2 ";
  cout << endl;
}
int main() {
  int n;
  cin >> n;
  SieveOfEratosthenes(n + 1);
  return 0;
}
