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