#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long w = 0, h = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') h = -h;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    w = w * 10 + ch - '0';
    ch = getchar();
  }
  return w * h;
}
long long n;
bool vis[100010];
signed main() {
  n = read();
  if (n == 1 || n == 2)
    puts("1");
  else
    puts("2");
  for (long long i = 2; i <= n + 1; i++) {
    if (vis[i]) continue;
    for (long long j = 2; i * j <= n + 1; j++) vis[i * j] = 1;
  }
  for (long long i = 2; i <= n + 1; i++)
    if (vis[i])
      printf("2 ");
    else
      printf("1 ");
  return 0;
}
