#include <bits/stdc++.h>
int main() {
  int n, count = 0, f = 0;
  scanf("%d", &n);
  if (n % 2 != 0) f = 1;
  count = n / 2;
  printf("%d\n", count);
  for (int i = 1; i < count; i++) printf("%d ", 2);
  if (f == 1)
    printf("%d", 3);
  else
    printf("%d", 2);
}
