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