#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, i;
  cin >> n;
  x = n / 2;
  cout << x << endl;
  for (i = 1; i < x; i++) {
    cout << "2 ";
  }
  if (n % 2 == 0)
    cout << "2\n";
  else
    cout << "3\n";
  return 0;
}
