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