#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a = 0;
  scanf("%d", &n);
  if (!(n & 1)) {
    a = n / 2;
    cout << a << endl;
    for (int z = 0; z < a; z++) printf("2 ");
  } else {
    a = n / 2;
    cout << a << endl;
    for (int z = 0; z < a - 1; z++) printf("2 ");
    printf("3 ");
  }
}
