#include <bits/stdc++.h>
using namespace std;
long long int pow_mod(long long int a, long long int b) {
  long long int res = 1;
  while (b != 0) {
    if (b & 1) {
      res = (res * a) % 1000000007;
    }
    a = (a * a) % 1000000007;
    b /= 2;
  }
  return res;
}
void solve() {
  long long int n;
  cin >> n;
  long long int a, b, c;
  cin >> a >> b >> c;
  vector<long long int> vv;
  vv.push_back(a);
  vv.push_back(b);
  vv.push_back(c);
  if (!vv.empty()) sort(vv.begin(), vv.end());
  a = vv[0];
  b = vv[1];
  c = vv[2];
  multiset<long long int> ms;
  for (long long int i = 0; i < n; i++) {
    long long int x;
    cin >> x;
    ms.insert(x);
  }
  long long int ans = 0;
  auto u = ms.end();
  u--;
  long long int value = *u;
  if (value > a + b + c) {
    cout << "-1\n";
    return;
  }
  while (!ms.empty()) {
    auto it = ms.end();
    it--;
    long long int val = *it;
    if (val <= b + c) break;
    ++ans;
    ms.erase(it);
  }
  long long int cnt = 0;
  while (!ms.empty()) {
    auto it = ms.end();
    it--;
    long long int val = *it;
    if (val <= a + c) break;
    ++cnt;
    ++ans;
    ms.erase(it);
  }
  while (cnt--) {
    if (ms.empty()) break;
    auto it = ms.upper_bound(a);
    if (it == ms.begin()) break;
    it--;
    ms.erase(it);
  }
  cnt = 0;
  while (!ms.empty()) {
    auto it = ms.end();
    if (it == ms.begin()) break;
    it--;
    long long int val = *it;
    if (val <= max(c, a + b)) break;
    ++cnt;
    ++ans;
    ms.erase(it);
  }
  while (cnt--) {
    if (ms.empty()) break;
    auto it = ms.upper_bound(b);
    if (it == ms.begin()) break;
    it--;
    ms.erase(it);
  }
  long long int x = 0;
  long long int y = 0;
  for (auto xx : ms) {
    if (xx <= a + b) x++;
    if (xx <= c) ++y;
  }
  long long int res = ans;
  ans += max({(max(x, y) + 1) / 2, x - y, y - x});
  cnt = 0;
  while (!ms.empty()) {
    auto it = ms.upper_bound(a);
    long long int d = 0;
    long long int vl;
    if (it != ms.begin()) {
      it--;
      ++d;
      vl = *it;
      if (vl <= a + b) x--;
      if (vl <= c) y--;
      ms.erase(it);
    }
    if (!ms.empty()) {
      it = ms.upper_bound(b);
      if (it != ms.begin()) {
        --it;
        vl = *it;
        if (vl <= a + b) x--;
        if (vl <= c) y--;
        ms.erase(it);
        ++d;
      }
    }
    if (!ms.empty()) {
      it = ms.upper_bound(c);
      if (it != ms.begin()) {
        --it;
        vl = *it;
        if (vl <= a + b) x--;
        if (vl <= c) y--;
        ms.erase(it);
        ++d;
      }
    }
    if (d) ++cnt;
    ans = min(ans, res + cnt + max({(max(x, y) + 1) / 2, x - y, y - x}));
    if (d == 0) break;
  }
  cout << ans << endl;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  t = 1;
  while (t--) solve();
  return 0;
}
