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