#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e6 + 10;
const int M = (int)5e3 + 10;
const int MXI = (int)5e5 + 10;
const int INF = (int)2e9 + 10;
const long long LLINF = (long long)1e18 + 10;
long long n;
bool prime[N];
int t[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i <= n + 2; i++) t[i] = 2;
  for (int i = 2; i <= 100000; i++) {
    if (prime[i] == 0) {
      t[i] = 1;
      for (int j = i; j <= n + 2; j += i) {
        prime[j] = 1;
      }
    }
  }
  if (n == 1 || n == 2) {
    cout << 1 << endl;
    if (n == 1)
      cout << 1;
    else
      cout << 1 << ' ' << 1;
  } else {
    cout << 2 << endl;
    for (int i = 2; i <= n + 1; i++) cout << t[i] << ' ';
  }
  return 0;
}
