// Arup Guha
// 6/19/2025
// Solution to Composed Rhythms
// https://open.kattis.com/problems/composedrhythms

using namespace std;
#include <bits/stdc++.h>

int main() {

    int n;
    cin >> n;

    vector<int> pieces;

    // Even is easy.
    if (n%2 == 0) {
        for (int i=0; i<n/2; i++)
            pieces.push_back(2);
    }

    // So is odd.
    else {
        pieces.push_back(3);
        n -= 3;
        for (int i=0; i<n/2; i++)
            pieces.push_back(2);
    }

    cout << pieces.size() << endl;
    for (int i=0; i<pieces.size(); i++)
        cout << pieces[i] << " ";
    cout << endl;

    return 0;
}
