#include <bits/stdc++.h>
using namespace std;
bool a[100010];
int main() {
  int n;
  cin >> n;
  for (int i = 2; i <= 100010; i++) a[i] = 1;
  for (int i = 4; i <= 100010; i++) {
    int tmp = sqrt(i);
    int c = 0;
    for (int j = 2; j <= tmp; j++) {
      if (i % j == 0) {
        c = 1;
      }
      if (c == 1) {
        a[i] = 0;
        break;
      }
    }
  }
  if (n == 1) {
    cout << 1 << endl;
    cout << 1;
    return 0;
  }
  if (n == 2) {
    cout << 1 << endl;
    cout << 1 << " " << 1;
    return 0;
  }
  cout << 2 << endl;
  for (int i = 2; i <= n + 1; i++) {
    if (a[i] == 1)
      cout << 1;
    else
      cout << 2;
    cout << " ";
  }
}
