#include <bits/stdc++.h>
int main() {
  int n;
  std::cin >> n;
  if (n == 1) {
    std::cout << "1\n1";
    return 0;
  }
  if (n == 2) {
    std::cout << "1\n1 1";
    return 0;
  }
  std::vector<bool> prime(n + 2, true);
  std::cout << "2\n";
  for (int i = 2; i < n + 2; i++) {
    if (prime[i]) {
      std::cout << "1 ";
      for (int j = i * i; j > 0 && j < n + 2; j += i) prime[j] = false;
    } else
      std::cout << "2 ";
  }
}
