#include <bits/stdc++.h>
int *prime;
int *check;
int main() {
  int tot = 0, i, j, n;
  scanf("%d", &n);
  if (n < 3)
    printf("1\n");
  else
    printf("2\n");
  prime = (int *)calloc(100010, sizeof(int));
  check = (int *)calloc(100010, sizeof(int));
  for (i = 2; i <= 100000; i++) {
    if (!check[i]) prime[tot++] = i;
    for (j = 0; j < tot; j++) {
      if (i * prime[j] > 100010) break;
      check[i * prime[j]] = 1;
      if (i % prime[j] == 0) break;
    }
  }
  for (i = 2; i <= n + 1; i++)
    printf(i == n + 1 ? "%d\n" : "%d ", check[i] + 1);
  return 0;
}
