#include <bits/stdc++.h>
using namespace std;
long long Gcd(long long a, long long b) {
  if (b == 0) return a;
  return Gcd(b, a % b);
}
int Min(int a, int b, int c) {
  a = a < b ? a : b;
  a = a < c ? a : c;
  return a;
}
int main() {
  long long x, factor;
  cin >> x;
  if (x < 4) {
    cout << 1 << endl;
    cout << x << endl;
  } else if (x % 2 == 0) {
    factor = x / 2;
    cout << factor << endl;
    for (int i = 0; i < factor; i++) {
      cout << 2 << " ";
    }
    cout << endl;
  } else {
    x--;
    factor = x / 2;
    cout << factor << endl;
    for (int i = 0; i < factor - 1; i++) {
      cout << 2 << " ";
    }
    cout << 3 << endl;
  }
  return 0;
}
