#include <bits/stdc++.h>
using namespace std;
long long m[4];
int main() {
  int n;
  long long x;
  scanf("%d", &n);
  for (int i = 0; i < 3; i++) scanf("%I64d", &m[i]);
  sort(m, m + 3);
  multiset<long long> criminal;
  multiset<long long>::iterator it;
  for (int i = 0; i < n; i++) {
    scanf("%I64d", &x);
    criminal.insert(x);
  }
  long long abc = m[0] + m[1] + m[2];
  long long bc = m[1] + m[2];
  long long ac = m[0] + m[2];
  long long ab = m[0] + m[1];
  long long a = m[0];
  long long b = m[1];
  long long c = m[2];
  long long ans = 0;
  while (true) {
    it = criminal.upper_bound(bc);
    if (it == criminal.end()) break;
    long long cur = *it;
    if (cur > abc) {
      printf("-1\n");
      return 0;
    }
    ans++;
    criminal.erase(it);
  }
  while (true) {
    it = criminal.upper_bound(ac);
    if (it == criminal.end()) break;
    long long cur = *it;
    ans++;
    criminal.erase(it);
    it = criminal.lower_bound(a);
    cur = *it;
    if (it != criminal.end() && cur <= a)
      criminal.erase(it);
    else {
      if (it != criminal.begin()) {
        it--;
        cur = *it;
        if (cur <= a) criminal.erase(it);
      }
    }
  }
  while (true) {
    it = criminal.upper_bound(max(ab, c));
    if (it == criminal.end()) break;
    long long cur = *it;
    ans++;
    criminal.erase(it);
    it = criminal.lower_bound(b);
    cur = *it;
    if (it != criminal.end() && cur <= b)
      criminal.erase(it);
    else {
      if (it != criminal.begin()) {
        it--;
        cur = *it;
        if (cur <= b) criminal.erase(it);
      }
    }
  }
  long long best = INT_MAX, one = 0, two = 0;
  for (it = criminal.begin(); it != criminal.end(); it++) {
    if (*it <= ab) one++;
    if (*it <= c) two++;
  }
  long long cont = 0;
  for (int i = 0; i < n * 2; i++) {
    if (2 * min(one, two) >= (int)criminal.size())
      best = min(best, i + ((long long)criminal.size() + 1) / 2);
    else
      best = min(best, i + (long long)criminal.size() - min(one, two));
    if (!criminal.size()) break;
    for (int j = 0; j < 3; j++) {
      it = criminal.upper_bound(m[j]);
      if (it != criminal.begin()) {
        it--;
        if (*it <= ab) one--;
        if (*it <= c) two--;
        criminal.erase(it);
      }
    }
    cont++;
  }
  printf(
      "%I64d"
      "\n",
      ans + best);
  return 0;
}
