#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void chkmax(T& x, U y) {
  if (x < y) x = y;
}
template <typename T, typename U>
inline void chkmin(T& x, U y) {
  if (y < x) x = y;
}
int n, a, b, c;
multiset<int> S;
multiset<int>::iterator it;
int main() {
  scanf("%d%d%d%d", &n, &a, &b, &c);
  for (int i = 0; i < n; i++) {
    int t;
    scanf("%d", &t);
    S.insert(t);
  }
  if (S.upper_bound(a + b + c) != S.end()) {
    puts("-1");
    return 0;
  }
  int ans = 0;
  int ma = max(a + b, max(a + c, b + c));
  while (!S.empty()) {
    it = --S.end();
    if (*it <= ma) break;
    S.erase(it);
    ans++;
  }
  ma = max(a, max(b, c));
  while (!S.empty()) {
    it = --S.end();
    if (*it <= ma) break;
    int mx = -1;
    if (*it <= a + b) chkmax(mx, c);
    if (*it <= a + c) chkmax(mx, b);
    if (*it <= b + c) chkmax(mx, a);
    S.erase(it);
    it = S.upper_bound(mx);
    if (it != S.begin()) {
      it--;
      S.erase(it);
    }
    ans++;
  }
  int sum = a + b + c;
  int mi1 = min(a, min(b, c));
  int mi2 = sum - ma - mi1;
  while (!S.empty()) {
    it = --S.end();
    S.erase(it);
    int val1 = -1, val2 = -1;
    it = S.upper_bound(mi2);
    if (it != S.begin()) {
      it--;
      val1 = *it;
      S.erase(it);
    }
    it = S.upper_bound(mi1);
    if (it != S.begin()) {
      it--;
      val2 = *it;
      S.erase(it);
    }
    if (val1 == -1 || val2 == -1) {
      if (val1 != -1) S.insert(val1);
      if (val2 != -1) S.insert(val2);
      it = S.upper_bound(sum - ma);
      if (it != S.begin()) {
        it--;
        S.erase(it);
      }
    }
    ans++;
  }
  printf("%d\n", ans);
  return 0;
}
