#include <bits/stdc++.h>
using namespace std;
int main() {
  int64_t n;
  cin >> n;
  multiset<int64_t> S;
  if (n & 1) {
    n--;
    cout << n / 2 << endl;
    while (n) {
      S.insert(2);
      n = n - 2;
    }
    auto itr = S.end();
    itr--;
    S.erase(itr);
    S.insert(3);
  } else {
    cout << n / 2 << endl;
    while (n) {
      S.insert(2);
      n = n - 2;
    }
  }
  for (auto itr = S.begin(); itr != S.end(); itr++) {
    cout << (*itr) << " ";
  }
}
