#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using LD = long double;
vector<int> color(100000 + 100, 1);
void hm() {
  int n = color.size();
  for (int i = 2; i < n; ++i) {
    if (color[i] > 1) {
      continue;
    }
    for (int j = i + i; j < n; j += i) {
      color[j] = (color[i] + 1);
    }
  }
  return;
}
int main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout.setf(ios_base::fixed);
  cout.precision(24);
  srand(179);
  string a, b;
  int n;
  hm();
  cin >> n;
  int mx = 0;
  for (int i = 0; i < n; ++i) {
    mx = max(mx, color[i + 2]);
  }
  cout << mx << "\n";
  for (int i = 0; i < n; ++i) {
    cout << color[i + 2] << " ";
  }
  return 0;
}
