#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long INFl = 9223372036854775807ll;
const int inf = (1 << 28) - 1;
long long power(long long x, long long y, long long z) {
  long long t = 1;
  while (y > 0) {
    if (y % 2) {
      t = (t * x) % z;
    }
    x = (x * x) % z;
    y /= 2;
  }
  return t;
}
int movex[4] = {0, 1, -1, 0};
int movey[4] = {1, 0, 0, -1};
int movexx[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
int moveyy[8] = {1, 1, 1, 0, -1, -1, -1, 0};
double sqr(double x) { return x * x; }
int f[200005];
int main() {
  int k = 0, i, cur, n, j;
  scanf("%d", &n);
  for (i = 2; i <= n + 1; i++)
    if (!f[i]) {
      f[i] = cur = 1;
      for (j = i * 2; j <= n + 1; j += i) f[j] = 2, cur = 2;
      k = max(k, cur);
    }
  printf("%d\n", k);
  for (i = 2; i <= n + 1; i++) printf("%d ", f[i]);
  return 0;
}
