#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  std::vector<int> v;
  for (int i = 0; i < n / 2; i++) {
    v.push_back(2);
  }
  if (n % 2 != 0) {
    v.pop_back();
    v.push_back(3);
  }
  cout << v.size() << endl;
  for (auto a : v) cout << a << " ";
  return 0;
}
