#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000000;
void Search(string pat, string text) {
  int M = ((int)(pat.size())), N = ((int)(text.size()));
  for (int i = 0; i <= N - M; i++) {
    int j;
    for (j = 0; j < M; j++)
      if (text[i + j] != pat[j]) break;
    if (j == M) cout << "Pattern found at index " << i << "\n";
  }
}
bool isletter(char f) { return f >= 'a' && f <= 'z'; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, k = 0;
  cin >> n;
  vector<int> primes;
  while (n >= 2) {
    if (n == 3) {
      primes.push_back(n);
      n -= 3;
      break;
    }
    n -= 2;
    primes.push_back(2);
  }
  cout << ((int)(primes.size())) << endl;
  for (int i = 0; i < (int)((int)(primes.size())); i++)
    cout << primes[i] << " ";
  cout << endl;
  return 0;
}
