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