#include <bits/stdc++.h>
int n;
bool val[100100];
void Init() {
  memset(val, 0, sizeof(val));
  val[0] = val[1] = 1;
  int i, j;
  for (i = 2; i < 100100; i++) {
    if (!val[i]) {
      for (j = i + i; j < 100100; j += i) {
        val[j] = 1;
      }
    }
  }
}
int main() {
  Init();
  while (~scanf("%d", &n)) {
    if (n <= 2) {
      printf("1\n");
      int i;
      for (i = 2; i <= n + 1; i++) {
        if (val[i])
          printf("2 ");
        else
          printf("1 ");
      }
      printf("\n");
    } else {
      printf("2\n");
      int i;
      for (i = 2; i <= n + 1; i++) {
        if (val[i])
          printf("2 ");
        else
          printf("1 ");
      }
      printf("\n");
    }
  }
  return 0;
}
