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