#include <bits/stdc++.h>
using namespace std;
bool aval[200009];
int main() {
  long long n;
  cin >> n;
  for (long long i = 2; i * i <= n + 6; i++) {
    if (!aval[i]) {
      for (long long j = i * i; j <= n + 6; j += i) {
        aval[j] = 1;
      }
    }
  }
  if (n < 3) {
    cout << 1 << endl;
    for (long long i = 1; i <= n; i++) {
      cout << "1 ";
    }
    return 0;
  }
  cout << 2 << endl;
  for (long long i = 2; i <= n + 1; i++) {
    if (aval[i]) {
      cout << 1 << ' ';
    } else {
      cout << 2 << ' ';
    }
  }
}
