#include <bits/stdc++.h>
using namespace std;
int n, k;
vector<int> ans;
void solve() {
  scanf("%d", &n);
  while (n > 3) {
    ans.emplace_back(2);
    n -= 2;
  }
  ans.emplace_back(n);
  printf("%d\n", (int)ans.size());
  for (auto x : ans) printf("%d ", x);
}
int main() {
  int t = 1;
  while (t--) solve();
  return 0;
}
