#include <bits/stdc++.h>
int n;
inline int ok(int n) {
  for (int i = 2; i * i <= n; ++i)
    if (n % i == 0) return 0;
  return 1;
}
int main() {
  std::ios_base::sync_with_stdio(0);
  std::cin >> n;
  if (n <= 2)
    std::cout << "1\n";
  else
    std::cout << "2\n";
  for (int i = 2; i <= n + 1; ++i) {
    if (ok(i))
      std::cout << "1 ";
    else
      std::cout << "2 ";
  }
  std::cout << "\n";
  return 0;
}
