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