#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
int n;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n;
  if (n % 2 == 0) {
    cout << n / 2;
    cout << '\n';
    for (int i = 0; i < n / 2; ++i) {
      cout << "2 ";
    }
    return 0;
  }
  n -= 3;
  cout << n / 2 + 1;
  cout << '\n';
  cout << "3 ";
  for (int i = 0; i < n / 2; ++i) {
    cout << "2 ";
  }
  return 0;
}
