#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[100001];
  for (int i = 0; i <= 100000; i++) arr[i] = 1;
  arr[0] = 0;
  arr[1] = 0;
  for (int i = 2; i <= sqrt(100000); i++) {
    for (int j = 2; i * j <= 100000; j++) {
      arr[i * j] = 0;
    }
  }
  if (n == 1) return cout << "1" << endl << "1", 0;
  if (n == 2) return cout << "1" << endl << "1 1", 0;
  vector<int> v;
  for (int i = 1; i <= 100000; i++) {
    if (arr[i] == 1) v.push_back(i);
  }
  vector<int> ans;
  for (int i = 2; i <= n + 1; i++) {
    int c = 1;
    for (int j = 0; j < v.size(); j++) {
      if (i % v[j] == 0 && i != v[j]) {
        c = 2;
        break;
      }
    }
    ans.push_back(c);
  }
  cout << "2" << endl;
  for (int x : ans) cout << x << " ";
  return 0;
}
