#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long arr[n + 10];
  memset(arr, 0, sizeof arr);
  arr[0] = 1;
  arr[1] = 1;
  long long flg = 0;
  long long ans[n + 5];
  memset(ans, 0, sizeof arr);
  for (long long i = 2; i <= n; i++) {
    if (arr[i] == 0) {
      flg++;
      ans[i] = flg;
      for (long long j = i * i; j <= n; j += i) {
        arr[j] = 1;
        ans[j] = flg;
      }
    }
  }
  for (long long i = 2; i <= n; i++) {
    cout << ans[i] << " ";
  }
}
