#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  cin >> n;
  cout << n / 2 << endl;
  while (n > 3) {
    cout << 2 << " ";
    n -= 2;
  }
  if (n == 3)
    cout << 3;
  else
    cout << 2;
  return 0;
}
