#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a;
  while (n > 3) {
    n = n - 2;
    a.push_back(2);
  }
  if (n == 3)
    a.push_back(3);
  else
    a.push_back(2);
  cout << a.size() << endl;
  for (int i = 0; i < a.size(); i++) cout << a[i] << " ";
  return 0;
}
