#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i = 0, i2 = 0, n2 = 0, n3 = 0;
  cin >> n;
  n2 = n / 2;
  n3 = n2 * 2;
  n = n - n3;
  i = n2 - n;
  i2 = n;
  cout << n2 << endl;
  for (int j = 1; j <= i; ++j) {
    cout << 2 << " ";
  }
  for (int j = 1; j <= i2; ++j) {
    cout << 3 << " ";
  }
  return 0;
}
