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