#include <bits/stdc++.h>
using namespace std;
int a, b;
int main() {
  cin >> a;
  b = a / 2 - 1;
  cout << a / 2 << endl;
  for (int i = 0; i < b; i++) {
    cout << 2 << " ";
  }
  if (a % 2 == 1) {
    cout << 3;
  } else {
    cout << 2;
  }
}
