#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; ++i) v[i] = i + 2;
  int n_colors = 1;
  vector<bool> prime(n, true);
  vector<int> colors(n);
  for (int i = 0; v[i] <= sqrt(n + 1); ++i) {
    if (prime[i]) {
      for (int j = v[i] * v[i] - 2; j < n; j += v[i]) {
        prime[j] = false;
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    if (prime[i]) {
      colors[i] = 1;
    } else {
      n_colors = 2;
      colors[i] = 2;
    }
  }
  cout << n_colors << endl;
  for (auto c : colors) cout << c << " ";
  cout << endl;
  return 0;
}
