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