#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << 1 << "\n";
    cout << 1 << "\n";
    return 0;
  }
  if (n == 2) {
    cout << 1 << "\n";
    cout << 1 << ' ' << 1 << "\n";
    return 0;
  }
  cout << 2 << "\n";
  vector<int> prime;
  prime.push_back(2);
  for (int i = 3; i <= n + 1; i++) {
    bool f = true;
    for (int j = 0; j < prime.size(); j++) {
      if (i % prime[j] == 0) {
        f = false;
        break;
      }
    }
    if (f) {
      prime.push_back(i);
    }
  }
  vector<int> used(n + 2);
  for (int i = 0; i < prime.size(); i++) {
    used[prime[i]] = 1;
  }
  for (int i = 2; i < n + 2; i++) {
    if (used[i] == 1) {
      cout << 1 << ' ';
    } else {
      cout << 2 << ' ';
    }
  }
  cout << "\n";
}
