#include <bits/stdc++.h>
using namespace std;
int const N = 100002;
int spf[N];
bool is_prime[N];
vector<int> primeFactors[N];
void spf_table(int n) {
  for (int i = 2; i <= n + 1; i++) is_prime[i] = true;
  for (int d = 2; d <= n + 1; d++) {
    if (!is_prime[d]) continue;
    for (int num = 2 * d; num <= n + 1; num += d) {
      is_prime[num] = false;
    }
  }
}
void Distinct_primeFactors_list(int n) {
  for (int i = 2; i <= n + 1; i++) {
    int j = i;
    unordered_map<int, int> unique;
    while (j != 1) {
      int a = spf[j];
      if (!unique.count(a)) {
        primeFactors[i].push_back(a);
        unique[a]++;
      }
      j = j / spf[j];
    }
  }
}
int main() {
  int n;
  cin >> n;
  spf_table(n);
  if (n >= 3) {
    cout << 2 << "\n";
  } else {
    cout << 1 << "\n";
  }
  for (int i = 2; i <= n + 1; i++) {
    if (is_prime[i]) {
      cout << 1 << " ";
    } else {
      cout << 2 << " ";
    }
  }
  return 0;
}
