#include <bits/stdc++.h>
using namespace std;
mt19937 gen;
const int INF = (int)1.01e9;
const int MOD = 1000000007;
const double EPS = 1e-9;
const double PI = acos(-1);
const int MAXN = 100005;
int cnt[MAXN];
bool solve() {
  long long n;
  if (!(cin >> n)) return false;
  if (n == 1) {
    puts("1\n1");
    return true;
  } else if (n == 2) {
    puts("1\n1 1");
    return true;
  }
  for (int i = 2; i * i <= n + 1; i++) {
    if (cnt[i]) continue;
    for (int j = i * i; j <= n + 1; j += i) cnt[j] = 1;
  }
  puts("2");
  for (int i = 2; i <= n + 1; i++) printf("%d ", cnt[i] + 1);
  puts("");
  return true;
}
int main() {
  while (solve()) {
  }
  return 0;
}
