#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
int N, X, F[5], Current4, CurrentLess, Ans = INF, RemOut, TotalSpace;
int main() {
  scanf("%i", &N);
  for (int i = 1; i <= N; ++i) {
    scanf("%i", &X);
    F[X]++;
    RemOut += X;
  }
  for (int i = 4; i >= 0; --i)
    for (int j = 1; j <= F[i]; ++j) {
      Current4 += i == 4;
      CurrentLess += (i <= 2 ? 3 - i : 0);
      TotalSpace += 4 - i;
      RemOut -= i;
      if (RemOut > TotalSpace) continue;
      if (CurrentLess > RemOut + Current4) continue;
      if (CurrentLess > RemOut)
        Ans = min(Ans, CurrentLess);
      else
        Ans = min(Ans, RemOut);
    }
  if (Ans == INF)
    printf("-1");
  else
    printf("%i", Ans);
}
