#include <bits/stdc++.h>
using namespace std;
bool Is_prime(int n) {
  for (int i = 2; i <= sqrt(n); i++)
    if (!(n % i)) return 0;
  return 1;
}
int main() {
  int n;
  while (~scanf("%d", &n)) {
    if (n <= 2)
      printf("1\n");
    else
      printf("2\n");
    printf("1");
    for (int i = 3; i <= n + 1; i++)
      if (Is_prime(i))
        printf(" 1");
      else
        printf(" 2");
    printf("\n");
  }
}
