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