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