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