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