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