#include <bits/stdc++.h>
using namespace std;
bool check(int n) {
  if (n == 2 || 3 == n) {
    return true;
  }
  for (int i = 2; i <= (int)sqrt(n) + 1; i++) {
    if (0 == n % i) {
      return false;
    }
  }
  return true;
}
int main() {
  int n;
  while (cin >> n) {
    if (n <= 1) {
      cout << n << endl;
      cout << 1 << endl;
    } else {
      if (2 == n) {
        cout << 1 << endl;
        cout << "1 1" << endl;
        continue;
      }
      cout << 2 << endl;
      for (int i = 2; i <= n + 1; i++) {
        if (check(i)) {
          cout << 1;
        } else {
          cout << 2;
        }
        if (i == n + 1) {
          cout << endl;
        } else {
          cout << " ";
        }
      }
    }
  }
  return 0;
}
