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