#include <bits/stdc++.h>
using namespace std;
int N, rs;
int main() {
  cin >> N;
  if (N & 1) N -= 3, rs++;
  cout << N / 2 + rs << '\n';
  for (int i = 1; i <= N / 2; ++i) cout << 2 << " ";
  for (int i = 1; i <= rs; ++i) cout << 3;
}
