#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<int> v;
  while (n) {
    if (n - 2 == 1) {
      v.push_back(3);
      n -= 3;
    } else {
      n -= 2;
      v.push_back(2);
    }
  }
  cout << v.size() << endl;
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) {
    printf("%d ", v[i]);
  }
  return 0;
}
