#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int maxn = 100005;
const long long mod = 1e9 + 7;
bool prime[maxn];
void getPrime() {
  for (int i = int(0); i <= int(maxn - 1); i++) prime[i] = 1;
  for (int i = int(2); i <= int(maxn - 1); i++) {
    if (prime[i]) {
      for (int j = i * 2; j < maxn; j += i) {
        prime[j] = 0;
      }
    }
  }
}
int main() {
  int n;
  cin >> n;
  cout << (n <= 2 ? 1 : 2) << endl;
  getPrime();
  for (int i = int(2); i <= int(n + 1); i++) {
    if (prime[i])
      cout << '1' << " ";
    else
      cout << '2' << " ";
  }
  return 0;
}
