#include <bits/stdc++.h>
using namespace std;
bool fl[1000010];
void sie() {
  for (int i = 4; i <= 1000000; i += 2) {
    fl[i] = true;
  }
  for (int i = 3; i <= 1000000; i += 2) {
    for (int j = 2 * i; j <= 1000000; j += i) {
      fl[j] = true;
    }
  }
}
int col[1000010];
int main() {
  sie();
  int n;
  cin >> n;
  for (int i = 2; i <= n + 1; i++) {
    if (fl[i] == true) {
      col[i] = 2;
    } else {
      col[i] = 1;
    }
  }
  if (n > 2)
    cout << 2 << endl;
  else
    cout << 1 << endl;
  for (int i = 0; i < n; i++) {
    cout << col[i + 2] << " ";
  }
  return 0;
}
