#include <bits/stdc++.h>
using namespace std;
const int N = 100500;
int n, m, v[N], p[N], l[N];
void primes(int n) {
  for (int i = 2; i <= n; ++i) {
    if (!v[i]) {
      v[i] = i;
      p[++m] = i;
      l[i] = 1;
    }
    for (int j = 1; j <= m; ++j) {
      if (p[j] > v[i] || p[j] * i > n) break;
      v[p[j] * i] = p[j];
    }
  }
}
int main() {
  scanf("%d", &n);
  primes(n + 1);
  if (n > 2)
    printf("2\n");
  else
    printf("1\n");
  for (int i = 2; i <= n + 1; ++i) {
    if (l[i])
      printf("1 ");
    else
      printf("2 ");
  }
}
