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