#include <bits/stdc++.h>
using namespace std;
int n;
bool used[100005];
int col[100005];
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n + 1; ++i) {
    if (!used[i]) {
      used[i] = true;
      col[i] = 1;
      for (int j = i + i; j <= n + 1; j += i) {
        used[j] = true;
        col[j] = 2;
      }
    }
  }
  if (n <= 2)
    printf("1\n");
  else
    printf("2\n");
  for (int i = 2; i <= n + 1; ++i) {
    printf("%d ", col[i]);
  }
  return 0;
}
