#include <bits/stdc++.h>
using namespace std;
int a[(int)(1e5 + 50)], col[(int)(1e5 + 50)];
bool chk[(int)(1e5 + 50)];
vector<int> primes;
void s() {
  for (int i = 2; i < (int)(1e5 + 50); i++) {
    if (chk[i] == 1) continue;
    primes.push_back(i);
    for (int j = 2 * i; j < (int)(1e5 + 50); j += i) chk[j] = 1;
  }
}
void solve() {
  int n;
  scanf("%d", &n);
  s();
  for (int i = 0; i < primes.size(); i++) {
    if (primes[i] - 1 <= n) a[primes[i] - 1] = 1;
  }
  for (int i = 1; i <= n; i++) {
    if (!a[i]) a[i] = 2;
  }
  set<int> s;
  for (int i = 1; i <= n; i++) {
    s.insert(a[i]);
  }
  cout << (int)s.size() << endl;
  for (int i = 1; i <= n; i++) {
    printf("%d", a[i]);
    printf(" ");
  }
}
int main() {
  int t = 1;
  for (int i = 1; i <= t; i++) {
    solve();
  }
  return 0;
}
