#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int cnt = 0;
  int a[n + 1];
  memset(a, 0, sizeof(a));
  for (int i = 2; i <= n; i++) {
    if (!a[i]) {
      cnt++;
      for (int j = i; j <= n; j += i) a[j] = cnt;
    }
  }
  cout << a[2];
  for (int i = 3; i <= n; i++) cout << " " << a[i];
  cout << '\n';
  return 0;
}
