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