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