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