#include <bits/stdc++.h>
using namespace std;
long long bin_pow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res *= a;
    a *= a;
    b >>= 1;
  }
  return res;
}
int main() {
  int n;
  cin >> n;
  if (n & 1) {
    vector<int> v;
    v.push_back(3);
    n -= 3;
    while (n != 0) {
      v.push_back(2);
      n -= 2;
    }
    cout << v.size() << endl;
    for (auto i : v) cout << i << " ";
  } else {
    vector<int> v;
    while (n != 0) {
      v.push_back(2);
      n -= 2;
    }
    cout << v.size() << endl;
    for (auto i : v) cout << i << " ";
  }
  return 0;
}
