#include <bits/stdc++.h>
using namespace std;
int main() {
  int userInput, i, finalResult;
  string multi = "";
  cin >> userInput;
  while (!(userInput >= 2 && userInput <= 100000)) {
    cin >> userInput;
  }
  cout << userInput / 2 << "\n";
  if (userInput == 3) {
    cout << userInput;
  } else {
    for (i = 1; i <= userInput / 2; i++) {
      finalResult = userInput - (2 * i);
      multi += to_string(2) + " ";
      if (finalResult == 0) {
        cout << multi;
      }
      if (finalResult == 3) {
        cout << multi << "3";
      }
    }
  }
  return 0;
}
