#include <bits/stdc++.h>
using namespace std;
int n, a, b, c, ans;
int main() {
  scanf("%d%d%d%d", &n, &a, &b, &c);
  if (a > b) swap(a, b);
  if (a > c) swap(a, c);
  if (b > c) swap(b, c);
  int cnt[7]{}, s[7] = {a, b, c, a + b, a + c, b + c, a + b + c};
  sort(s, s + 7);
  for (int i = 0; i < n; i++) {
    int x, j;
    scanf("%d", &x);
    for (j = 0; j < 7; j++)
      if (x <= s[j]) {
        cnt[j]++;
        break;
      }
    if (j == 7) return puts("-1"), 0;
  }
  ans += cnt[6] + cnt[5] + cnt[4];
  int take = max(0, cnt[4] - cnt[1]);
  cnt[0] = max(0, cnt[0] - cnt[5] - take);
  cnt[1] = max(0, cnt[1] - cnt[4]);
  if (a + b > c) {
    ans += cnt[3];
    take = max(0, cnt[3] - cnt[2]);
    int take2 = max(0, take - cnt[1]);
    cnt[2] = max(0, cnt[2] - cnt[3]);
    cnt[1] = max(0, cnt[1] - take);
    cnt[0] = max(0, cnt[0] - take2);
    cnt[3] = 0;
  }
  int add = n, x = 0;
  do {
    add = min(
        add, x + max((cnt[0] + cnt[1] + cnt[2] + cnt[3] + 2) / 3,
                     max((cnt[1] + cnt[2] + cnt[3] + 1) / 2, cnt[2] + cnt[3])));
    if (cnt[3])
      cnt[3]--;
    else if (cnt[2])
      cnt[2]--;
  } while (x++, cnt[2]--);
  ans += add;
  printf("%d\n", ans);
  return 0;
}
