#include <bits/stdc++.h>
using namespace std;
bool isprime(int n) {
  for (int i = 2; i < n; i++) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}
int main() {
  int n;
  cin >> n;
  vector<int> ve;
  int cnt = n;
  if (n % 2 == 0) {
    cout << n / 2 << endl;
    int k = n / 2;
    while (k--) cout << 2 << " ";
  } else {
    cout << n / 2 << endl;
    int k = n / 2;
    while (--k) cout << 2 << " ";
    cout << 3;
  }
}
