#include <bits/stdc++.h>
using namespace std;
enum { North, East, South, West };
int mi[] = {-1, 0, 1, 0, -1, 1, 1, -1};
int mj[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int MN = 1e+5 + 35;
int data[MN];
bool isPrime(int x) {
  if (x == 2) return true;
  if (x % 2 == 0) return false;
  int sqx = (int)sqrt(x);
  for (int i = 3; i <= sqx; i += 2)
    if (x % i == 0) return false;
  return true;
}
void init() {
  freopen("in.txt", "r", stdin);
  freopen("out.txt", "w", stdout);
  cout << "[FREOPEN]" << endl;
  return;
}
int main() {
  int n;
  scanf("%d", &n);
  int k = (n >= 3);
  int ans = 1;
  for (int i = 2; i <= n + 1; i++) {
    data[i] = 1 + isPrime(i) * k;
    ans = max(ans, data[i]);
  }
  printf("%d\n", ans);
  for (int i = 2; i <= n + 1; i++) {
    i > 2 ? printf(" ") : NULL;
    printf("%d", data[i]);
  }
  printf("\n");
  return 0;
}
