#include <bits/stdc++.h>
using namespace std;
unsigned long long exp(unsigned long long x, unsigned long long n,
                       unsigned long long m) {
  unsigned long long res = 1;
  while (n > 0) {
    if (n % 2 == 1) {
      res = (res * x) % m;
    }
    x = (x * x) % m;
    n /= 2;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  if (n == 1) {
    cout << 1 << "\n" << 1;
    return 0;
  } else if (n == 2) {
    cout << 1 << "\n" << 1 << " " << 1;
    return 0;
  } else {
    cout << 2 << "\n";
  }
  bool flag;
  for (int i = 2; i <= n + 1; i++) {
    flag = 0;
    for (int j = 2; j * j <= i; j++) {
      if (i % j == 0) {
        cout << 2 << " ";
        flag = 1;
        break;
      }
    }
    if (flag == 0) {
      cout << 1 << " ";
    }
  }
  return 0;
}
