#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main() {
    int n;
    cin >> n;
    cout << n / 2 << '\n';
    if (n % 2) {
        cout << 3 << ' ';
        n -= 3;
    }
    while (n) {
        cout << 2 << ' ';
        n -= 2;
    }
    cout << '\n';
}
