#include <bits/stdc++.h>
int main() {
  int n, ndiv2;
  scanf("%d", &n);
  ndiv2 = n / 2;
  printf("%d\n", ndiv2);
  for (int i = 0; i < ndiv2 - 1; i++) printf("2 ");
  printf((n % 2 == 0) ? "2" : "3");
  return 0;
}
