#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int t = 100002;
  int sieve[t];
  for (int i = 0; i < t; i++) sieve[i] = 1;
  for (int i = 4; i < t; i += 2) sieve[i] = 0;
  for (int i = 3; i * i < t; i += 2) {
    if (sieve[i]) {
      for (int j = i * i; j < t; j += i) sieve[j] = 0;
    }
  }
  unordered_map<int, int> m;
  unordered_set<int> s;
  for (int i = 2; i <= n + 1; i++) {
    if (sieve[i]) {
      s.insert(1);
      m[i] = 1;
    } else {
      s.insert(2);
      m[i] = 2;
    }
  }
  cout << s.size() << endl;
  for (int i = 2; i <= n + 1; i++) cout << m[i] << " ";
}
