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