#include <bits/stdc++.h>
using namespace std;
long long int arr[1000001];
string str;
int main() {
  ios::sync_with_stdio(false);
  cin.clear();
  long long int t, n, i, j, ans = 0, count = 0, sum = 0, k;
  vector<int> v;
  cin >> n;
  while (n) {
    if (n == 3) {
      v.push_back(3);
      n -= 3;
    } else {
      v.push_back(2);
      n -= 2;
    }
  }
  cout << v.size() << endl;
  for (i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
  }
}
