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