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