#include <bits/stdc++.h>
int n, m, i, j, k, ans, f[100005];
int main() {
  scanf("%d", &n);
  ans = ++n > 3 ? 2 : 1;
  for (i = 2; i <= n; i++) {
    if (f[i]) continue;
    for (j = i + i; j <= n; j += i) f[j] = 1;
  }
  printf("%d\n", ans);
  for (i = 2; i <= n; i++) printf("%d ", f[i] + 1);
  return 0;
}
