#include <bits/stdc++.h>
using namespace std;
const int SIZE = 100000 + 5;
const int INF = 1e9;
struct abc {
  int t, a, i;
};
bool operator<(abc a, abc b) { return a.t < b.t; }
int gcd(int a, int b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
bool inRange(int n, int x, int y) { return x > 0 && y > 0 && x <= n && y <= n; }
bool simple[SIZE + 1];
int main(int argc, char* argv[]) {
  for (long long i = 2; i * i < SIZE; ++i) {
    if (simple[i]) continue;
    for (long long j = i * i; j <= SIZE; j += i) {
      simple[j] = true;
    }
  }
  int n;
  scanf("%d", &n);
  if (n < 3) {
    printf("1\n");
    for (int i = 0; i < n; ++i) {
      printf("1 ");
    }
    return 0;
  }
  printf("2\n");
  for (int i = 0; i < n; ++i) {
    if (!simple[i + 2]) {
      printf("1 ");
    } else {
      printf("2 ");
    }
  }
  return 0;
}
