#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
const int maxp = 700000;
int vis[maxn];
int prime[maxp];
void sieve(int n) {
  int m = (int)sqrt(n + 0.5);
  memset(vis, 0, sizeof(vis));
  for (int i = 2; i <= m; i++)
    if (!vis[i])
      for (int j = i * i; j <= n; j += i) vis[j] = 1;
}
int gen_primes(int n) {
  sieve(n);
  int c = 0;
  for (int i = 2; i <= n; i++)
    if (!vis[i]) prime[c++] = i;
  return c;
}
int main() {
  int n, k, tab[100004];
  scanf("%d", &k);
  int c = gen_primes(k + 1);
  for (int i = 0; i < k; i++) {
    tab[i] = 2;
    if (vis[i + 2] == 0) {
      tab[i] = 1;
    }
  }
  if (k <= 2) {
    printf("%d\n", 1);
  } else {
    printf("%d\n", 2);
  }
  for (int i = 0; i < k; i++) {
    printf("%d ", tab[i]);
  }
  printf("\n");
  ;
  return 0;
}
