#include <bits/stdc++.h>
int ifeven(int n) {
  if (n % 2 == 0)
    return 1;
  else
    return 0;
}
int main() {
  int i, n, k, l, r = 0;
  scanf("%d", &n);
  if (ifeven(n)) {
    while (n != 0) {
      r++;
      n -= 2;
    }
    printf("%d\n", r);
    for (i = 0; i < r; i++) {
      printf("2 ");
    }
  } else {
    r++;
    n -= 3;
    while (n != 0) {
      r++;
      n -= 2;
    }
    printf("%d\n", r);
    for (i = 1; i < r; i++) {
      printf("2 ");
    }
    printf("3 ", r);
  }
  return 0;
}
