#include <bits/stdc++.h>
using namespace std;
int a[100005];
int main() {
  std::ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int i, j;
  for (i = 2; i <= n + 1; i++) {
    if (a[i] == 0)
      for (j = 2 * i; j <= n + 1; j += i) {
        a[j] = 1;
      }
  }
  if (n > 2)
    cout << "2\n";
  else
    cout << "1\n";
  for (i = 2; i <= n + 1; i++) {
    if (a[i] == 0)
      cout << "1 ";
    else
      cout << "2 ";
  }
  return 0;
}
