#include <bits/stdc++.h>
const int K = 1e5 + 10;
int a[K];
int main() {
  int N;
  for (int i = 2; i < K; i++) {
    if (a[i]) continue;
    for (int j = i + i; j < K; j += i) a[j] = 1;
  }
  while (scanf("%d", &N) != EOF) {
    if (N <= 2) {
      printf("1\n");
      if (N == 1)
        printf("1\n");
      else
        printf("1 1\n");
    } else {
      printf("2\n");
      for (int i = 2; i <= N + 1; i++)
        if (a[i])
          printf("2 ");
        else
          printf("1 ");
    }
  }
  return 0;
}
