#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int a;
  cin >> a;
  if (a % 2 == 0) {
    int b = a / 2;
    cout << b << '\n';
    while (b--) cout << 2 << " ";
  } else {
    int c = (a - 1) / 2;
    cout << c << '\n';
    while (c > 1) {
      cout << 2 << " ";
      c--;
    }
    cout << 3;
  }
}
