#include <bits/stdc++.h>
using namespace std;
bool vis[100001];
int make[100001], cnt = 0;
void linear_prime_build(int n) {
  int i, j;
  for (i = 2; i <= n; i++) {
    if (!vis[i]) make[++cnt] = i;
    for (j = 1; j <= cnt && i * make[j] <= n; j++) {
      vis[i * make[j]] = true;
      if (i % make[j] == 0) break;
    }
  }
}
int main() {
  int n, i;
  scanf("%d", &n);
  n++;
  linear_prime_build(n);
  printf(n <= 3 ? "1\n" : "2\n");
  for (i = 2; i <= n; i++) printf(vis[i] ? "2 " : "1 ");
}
