#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  if (n % 2 == 0) {
    cout << n / 2 << "\n";
    for (int i = 1; i <= n / 2; i++) cout << "2 ";
  } else {
    cout << (n - 3) / 2 + 1 << "\n";
    cout << "3 ";
    n -= 3;
    for (int i = 1; i <= n / 2; i++) cout << "2 ";
  }
}
