#include <bits/stdc++.h>
using namespace std;
bool Primes(long long int n) {
  long long int i;
  vector<long long int> v;
  if (n == 2) return true;
  if (n % 2 == 0) return false;
  for (i = 2; i <= (long long int)sqrt(n); i++) {
    if (n % i == 0) return false;
  }
  return true;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n, i;
  cin >> n;
  if (n == 1 || n == 2) {
    cout << "1" << endl;
    for (i = 0; i < n; i++) {
      cout << "1 ";
    }
    cout << endl;
    return 0;
  }
  cout << "2" << endl;
  for (i = 1; i <= n; i++) {
    if (Primes(i + 1)) {
      cout << "1 ";
    } else {
      cout << "2 ";
    }
  }
  cout << endl;
}
