#include <bits/stdc++.h>
using namespace std;
int n, mus[5], x, ans;
multiset<int> s;
int main() {
  cin >> n;
  for (int i = 0; i <= (int)(2); i++) cin >> mus[i];
  sort(mus, mus + 3);
  for (int i = 0; i <= (int)(n - 1); i++) {
    scanf("%d", &x);
    s.insert(x);
  }
  if (*s.rbegin() > mus[0] + mus[1] + mus[2]) {
    cout << "-1";
    return 0;
  }
  while ((!s.empty() && (*s.rbegin() > mus[1] + mus[2]))) {
    ans++;
    multiset<int>::iterator it = s.end();
    it--;
    s.erase(it);
  }
  while ((!s.empty() && (*s.rbegin() > mus[0] + mus[2]))) {
    ans++;
    multiset<int>::iterator it = s.end();
    it--;
    s.erase(it);
    it = s.upper_bound(mus[0]);
    if (it == s.begin())
      ;
    else {
      --it;
      s.erase(it);
    }
  }
  while ((!s.empty() && (*s.rbegin() > max(mus[0] + mus[1], mus[2])))) {
    ans++;
    multiset<int>::iterator it = s.end();
    it--;
    s.erase(it);
    it = s.upper_bound(mus[1]);
    if (it == s.begin())
      ;
    else {
      --it;
      s.erase(it);
    }
  }
  if (mus[0] + mus[1] > mus[2]) {
    while ((!s.empty() && (*s.rbegin() > mus[2]))) {
      ans++;
      multiset<int>::iterator it = s.end();
      it--;
      s.erase(it);
      it = s.upper_bound(mus[2]);
      if (it == s.begin())
        ;
      else {
        --it;
        s.erase(it);
      }
    }
    while (!s.empty()) {
      ans++;
      multiset<int>::iterator it = s.end();
      int fg = 0;
      it = s.upper_bound(mus[2]);
      if (it == s.begin())
        ;
      else {
        --it;
        s.erase(it);
      }
      it = s.upper_bound(mus[1]);
      if (it == s.begin())
        fg = 1;
      else {
        --it;
        s.erase(it);
      }
      if (fg == 1)
        it = s.upper_bound(mus[0] + mus[1]);
      else
        it = s.upper_bound(mus[0]);
      if (it == s.begin())
        ;
      else {
        --it;
        s.erase(it);
      }
    }
  } else {
    while (!s.empty()) {
      ans++;
      multiset<int>::iterator it = s.end();
      int fg = 0;
      it = s.upper_bound(mus[2]);
      if (it == s.begin())
        ;
      else {
        --it;
        s.erase(it);
      }
      it = s.upper_bound(mus[1]);
      if (it == s.begin())
        fg = 1;
      else {
        --it;
        s.erase(it);
      }
      if (fg == 1)
        it = s.upper_bound(mus[0] + mus[1]);
      else
        it = s.upper_bound(mus[0]);
      if (it == s.begin())
        ;
      else {
        --it;
        s.erase(it);
      }
    }
  }
  cout << ans;
}
