#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int N = 1e6;
set<char> vowel = {'A', 'O', 'Y', 'E', 'U', 'I', 'a', 'o', 'y', 'e', 'u', 'i'};
long long gcd(long long a, long long b) { return (b == 0 ? a : gcd(b, a % b)); }
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
int n, m, k, l, ans = 0, res = 0, posmin, posmax, x, y, z, xmax = 0, ymax = 0;
long long tab[N];
char c, c1;
string ch, ch1, ch2;
deque<int> q1, q2, q3, q4;
map<int, set<int> > adj;
map<pair<int, int>, vector<pair<int, int> > > mapai;
unordered_map<string, string> ss;
unordered_map<string, int> si;
set<char> sc;
set<long long> sx, sy;
vector<long long> v, vv;
vector<pair<int, int> > vvv;
vector<pair<string, string> > vpstr;
bool prime[N + 1];
void sieve() {
  for (int p = 2; p * p <= N; p++) {
    if (prime[p] == true) {
      for (int i = p * 2; i <= N; i += p) prime[i] = false;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  memset(prime, true, sizeof(prime));
  cin >> n;
  sieve();
  if (n <= 2)
    cout << 1 << "\n";
  else
    cout << 2 << "\n";
  for (int i = 2; i <= n + 1; i++) {
    cout << 2 - prime[i] << " ";
  }
  return 0;
}
