#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const int mxn = 1e5 + 5;
bool isPrime[mxn];
int color[mxn];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  for (int i = 0; i < mxn; i++) isPrime[i] = 1;
  isPrime[0] = isPrime[1] = 0;
  for (int i = 2; i < mxn; i++) {
    if (isPrime[i]) {
      for (ll j = 1ll * i * i; j < mxn; j += i) isPrime[j] = 0;
    }
  }
  int n;
  cin >> n;
  if (n == 1) {
    cout << 1 << '\n';
    cout << 1 << '\n';
    return 0;
  }
  if (n == 2) {
    cout << 1 << '\n';
    cout << 1 << " " << 1 << '\n';
    return 0;
  }
  cout << 2 << '\n';
  for (int i = 2; i <= n; i++) {
    if (isPrime[i])
      cout << 1 << " ";
    else
      cout << 2 << " ";
  }
  if (isPrime[n + 1])
    cout << 1 << '\n';
  else
    cout << 2 << '\n';
  return 0;
}
