#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  ios_base::sync_with_stdio(false);
  ;
  cin >> n;
  vector<int> resp;
  if (n % 2 == 1) {
    resp.push_back(3);
    n -= 3;
  }
  while (n > 0) {
    resp.push_back(2);
    n -= 2;
  }
  cout << resp.size() << "\n";
  for (int i = 0; i < resp.size(); i++) cout << resp[i] << " ";
}
