#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[100005] = {0};
  int i = 2;
  int cnt = 0;
  while (i * i <= n) {
    if (a[i] == 0) {
      cnt += 1;
      a[i] = cnt;
      int j = i * i;
      while (j <= n) {
        a[j] = cnt;
        j += i;
      }
    }
    i += 1;
  }
  for (int i = 2; i <= n; i++) {
    if (a[i] == 0) {
      a[i] = ++cnt;
    }
    cout << a[i] << " ";
  }
}
