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