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