#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  if (n == 2) {
    cout << 1 << endl;
  } else {
    int z = 0;
    vector<bool> mark(n, false);
    vector<int> ans(n + 1, 0);
    for (int i = 2; i <= n; i++) {
      if (mark[i] == false) {
        if (i == 2)
          z = 2;
        else if (i == 3)
          z = 1;
        else
          z++;
        ans[i] = z;
        for (int j = 2 * i; j <= n; j += i) {
          if (mark[j] == false) {
            ans[j] = z;
            mark[j] = true;
          }
        }
      }
      if (i == 3) z += 1;
    }
    for (int i = 2; i <= n; i++) cout << ans[i] << " ";
    cout << endl;
  }
}
