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