#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
vector<int> v;
bool prime[N];
void sieve() {
  for (int i = 2; i * i <= N; i++) {
    if (!prime[i]) {
      for (int j = i * i; j < N; j += i) {
        prime[j] = true;
      }
    }
  }
  for (int i = 2; i < N; i++) {
    if (!prime[i]) v.push_back(i);
  }
}
void solve() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << "1\n1\n";
    return;
  }
  if (n == 2) {
    cout << "1\n1 1\n";
    return;
  }
  sieve();
  cout << "2\n";
  for (int i = 2; i <= n + 1; i++) {
    if (*lower_bound(v.begin(), v.end(), i) == i) {
      cout << "1 ";
    } else {
      cout << "2 ";
    }
  }
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
