#include <bits/stdc++.h>
using namespace std;
template <typename T>
void print(vector<T> v) {
  for (T &i : v) cout << i << " ";
  cout << "\n";
}
template <typename T>
void read(vector<T> &v) {
  for (T &i : v) cin >> i;
}
long long mod = 1e9 + 7;
bool isprime(int n) {
  for (int i = 2; i * i <= n; ++i) {
    if (n % i == 0) return false;
  }
  return true;
}
void solve() {
  int n;
  cin >> n;
  vector<int> res;
  int one = 0, two = 0;
  for (int i = 2; i <= n + 1; ++i) {
    if (isprime(i))
      res.push_back(1), one = 1;
    else
      res.push_back(2), two = 1;
  }
  if (one == 1 && two == 1)
    cout << 2 << "\n";
  else if (one == 1 || two == 1)
    cout << 1 << "\n";
  print(res);
}
int main() {
  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int tcs = 1;
  while (tcs--) solve();
  return 0;
}
