#include <bits/stdc++.h>
using namespace std;
bool isPrime(int n) {
  for (int i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}
int arr[3];
void solve() {
  int n;
  cin >> n;
  vector<long long> store;
  for (long long i = 0; i < n; i++) {
    if (isPrime(i + 2)) {
      store.push_back(1);
      arr[1] = 1;
    } else {
      store.push_back(2);
      arr[2] = 1;
    }
  }
  if (arr[1] && arr[2]) {
    cout << 2 << endl;
  } else {
    cout << 1 << endl;
  }
  for (long long i = 0; i < store.size(); i++)
    cout << store[i] << (i + 1 < store.size() ? ' ' : '\n');
  ;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
