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