#include <bits/stdc++.h>
const int N = 250050;
using namespace std;
int lev[N];
int n;
int ar[N];
multiset<int> S;
int ans;
multiset<int>::iterator it;
int val;
pair<int, int> try3() {
  if (val > lev[2]) return make_pair(-1, -1);
  pair<int, int> P = make_pair(-1, -1);
  multiset<int>::iterator it1, it2;
  it1 = S.upper_bound(lev[1]);
  if (it1 == S.begin()) {
    return P;
  }
  --it1;
  P.first = (*it1);
  S.erase(it1);
  it2 = S.upper_bound(lev[0]);
  if (it2 == S.begin()) {
    return P;
  }
  --it2;
  P.second = (*it2);
  S.erase(it2);
  return P;
}
int try2() {
  int thold = 0;
  if (val <= lev[2]) thold = max(thold, lev[1] + lev[0]);
  if (val <= lev[1]) thold = max(thold, lev[0] + lev[2]);
  if (val <= lev[0]) thold = max(thold, lev[1] + lev[2]);
  if (val <= lev[0] + lev[1]) thold = max(thold, lev[2]);
  if (val <= lev[0] + lev[2]) thold = max(thold, lev[1]);
  if (val <= lev[1] + lev[2]) thold = max(thold, lev[0]);
  multiset<int>::iterator it;
  it = S.upper_bound(thold);
  if (it == S.begin()) return -1;
  --it;
  int cur = (*it);
  S.erase(it);
  return cur;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 0; i < 3; i++) {
    cin >> lev[i];
  }
  sort(lev, lev + 3);
  for (int i = 0; i < n; i++) {
    cin >> ar[i];
  }
  sort(ar, ar + n);
  if (ar[n - 1] > lev[0] + lev[1] + lev[2]) {
    cout << -1 << endl;
    return 0;
  }
  for (int i = 0; i < n; i++) S.insert(ar[i]);
  while (S.size()) {
    ans++;
    it = S.end();
    --it;
    val = (*it);
    S.erase(it);
    pair<int, int> P = try3();
    if (P.first != -1 && P.second != -1) {
      continue;
    }
    if (P.first != -1) S.insert(P.first);
    if (P.second != -1) S.insert(P.second);
    int Q = try2();
  }
  cout << ans << endl;
  cin.get();
  cin.get();
  return 0;
}
