#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[100000];
  for (int i = 2; i <= n + 1; i++) {
    for (int j = i + i; j <= n + 1; j += i) {
      arr[j] = 1;
    }
  }
  if (n <= 2) {
    cout << 1 << "\n";
    for (int i = 1; i <= n; i++) {
      cout << 1 << " ";
    }
    return 0;
  }
  cout << 2 << "\n";
  for (int i = 2; i <= n + 1; i++) {
    if (arr[i] == 1) {
      cout << "2 ";
    } else {
      cout << "1 ";
    }
  }
  return 0;
}
