#include <bits/stdc++.h>
using namespace std;
map<long long int, long long int> m, val, pos;
long long int a[100002];
long long int p[100002];
int main() {
  long long int n, i, j, k, l, x, y, f, z, q;
  f = 0;
  l = 0;
  y = 100002;
  for (i = 1; i <= y; i++) a[i] = i;
  for (i = 2; i <= y; i++) {
    if (a[i] == i)
      p[i] = 1;
    else
      continue;
    for (j = 2;; j++) {
      x = j * i;
      if (x > y) break;
      a[x] = a[x] / i;
    }
  }
  cin >> n;
  for (i = 1; i <= n; i++) {
    p[i + 1] == 0 ? f = 1 : l = 1;
  }
  if (f == 1 && l == 1)
    cout << 2 << endl;
  else {
    cout << 1 << endl;
    for (i = 1; i <= n; i++) {
      cout << "1 ";
    }
    exit(0);
  }
  for (i = 1; i <= n; i++) {
    p[i + 1] == 0 ? (cout << 1 << " ") : (cout << 2 << " ");
  }
}
