#include <bits/stdc++.h>
int pr[100005] = {0}, n, i, c = 1, j;
int main() {
  scanf("%d", &n);
  puts(n <= 2 ? "1" : "2");
  for (i = 2; i <= n + 1; i++) {
    if (pr[i] == 0) {
      for (j = i * 2; j <= n + 1; j += i) pr[j] = 1;
    }
    printf("%d ", c + pr[i]);
  }
}
