#include <bits/stdc++.h>
using namespace std;
int p[100002 + 1];
inline void primeDIV() {
  memset(p, 0, sizeof(p));
  for (int i = 2; i <= 100002; i++)
    if (p[i] == 0)
      for (int j = 2 * i; j <= 100002; p[j] = 1, j += i)
        ;
}
inline void printSOL(int n) {
  if (n <= 2) {
    cout << "1\n";
    for (int i = 1; i <= n; cout << 1 << " ", i++)
      ;
  } else {
    cout << "2\n";
    for (int i = 2; i <= n + 1; i++) cout << (p[i] == 0 ? "1" : "2") << " ";
  }
  cout << endl;
}
int main() {
  primeDIV();
  int n;
  scanf("%d", &n);
  printSOL(n);
  return 0;
}
