#include <bits/stdc++.h>
using namespace std;
long int input;
long int ans;
int main() {
  cin >> input;
  ans = input / 2;
  cout << ans << endl;
  for (int i = 0; i < ans - 1; i++) cout << "2 ";
  if (input % 2 != 0)
    cout << "3";
  else
    cout << "2";
  return 0;
}
