#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, num;
  while (~scanf("%d", &n)) {
    if (n % 2 == 0) {
      printf("%d\n", n / 2);
      num = n / 2;
      for (int i = 0; i < num; i++) {
        printf("2%c", i == num - 1 ? '\n' : ' ');
      }
    } else {
      printf("%d\n", n / 2);
      num = n / 2 - 1;
      for (int i = 0; i < num; i++) {
        printf("2 ");
      }
      printf("3\n");
    }
  }
  return 0;
}
