#include <bits/stdc++.h>
using namespace std;
vector<unsigned int> v;
unsigned int j = 0;
void insElem(unsigned int i, unsigned int n) {
  v.insert(v.begin() + j, (n / i));
  v.insert(v.begin() + j++, i);
}
void divisors(unsigned int n) {
  unsigned int rn = sqrt(n);
  for (unsigned int i = 1; i <= rn; i++)
    if ((n % i) == 0) insElem(i, n);
  if (v.at(j - 1) == v.at(j)) v.erase(v.begin() + j);
}
bool isPrime(unsigned int n) {
  divisors(n);
  bool r = (v.size() < 3);
  v.clear();
  j = 0;
  return r;
}
int main(int argc, char* argv[]) {
  unsigned int n;
  cin >> n;
  cout << (n > 2) + 1 << endl;
  for (unsigned int i = 1; i <= n; i++) cout << (!isPrime(i + 1)) + 1 << " ";
  return 0;
}
