#include <bits/stdc++.h>
int i;
using namespace std;
int ceel(long long int number, long long int divider) {
  double c;
  long long int c2, ans = 0;
  c2 = number / divider;
  c = (double)number / (double)divider;
  if ((c - c2) != 0) {
    ans = c2 + 1;
  } else {
    ans = c2;
  }
  return ans;
}
int main() {
  long long int n, nop;
  cin >> n;
  if (n % 2 == 0) {
    nop = n / 2;
    cout << nop << endl;
    for (int i = 1; i <= nop; i++) {
      cout << 2 << " ";
    }
  } else {
    nop = (n / 2) - 1;
    cout << nop + 1 << endl;
    for (int i = 1; i <= nop; i++) {
      cout << 2 << " ";
    }
    cout << 3;
  }
  return 0;
}
