#include <bits/stdc++.h>
using namespace std;
bool a[100100];
void cal() {
  a[0] = a[1] = 0;
  for (int i = 2; i < 100100; i++)
    if (a[i] == 1)
      for (int j = 2 * i; j < 100100; j += i) a[j] = 0;
}
int main() {
  memset(a, 1, sizeof a);
  cal();
  int n;
  cin >> n;
  if (n == 1 || n == 2) {
    cout << 1 << endl;
    for (int i = 0; i < n; i++) cout << "1 ";
    return 0;
  }
  cout << 2 << endl;
  for (int i = 0; i < n; i++) cout << a[i + 2] + 1 << ' ';
}
