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