#include <bits/stdc++.h>
using namespace std;
multiset<int> bad;
int a[3];
int n;
int ans;
bool erase(int val) {
  if (bad.empty()) return false;
  if (*bad.begin() > val) return false;
  auto it = bad.lower_bound(val);
  if (it == bad.end() || *it > val) it--;
  bad.erase(it);
  return true;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < 3; i++) {
    scanf("%d", &a[i]);
  }
  sort(a, a + 3);
  for (int i = 0, x; i < n; i++) {
    scanf("%d", &x);
    bad.insert(x);
  }
  if (*bad.rbegin() > a[0] + a[1] + a[2]) return !printf("-1");
  while (bad.size() && *bad.rbegin() > a[1] + a[2]) {
    ans++;
    auto it = bad.find(*bad.rbegin());
    bad.erase(it);
  }
  vector<int> g(3);
  for (int i = 0; i < 3; i++) g[i] = a[i];
  vector<pair<int, int> > q;
  q.push_back(make_pair(a[2], -1));
  do {
    pair<int, int> t(g[0] + g[1], g[2]);
    q.push_back(t);
  } while (next_permutation(g.begin(), g.end()));
  sort(q.begin(), q.end());
  q.erase(unique(q.begin(), q.end()), q.end());
  while ((int)q.size() > 1) {
    auto t = q.back();
    if (t.second < 0) break;
    q.pop_back();
    while (bad.size() && *bad.rbegin() > q.back().first) {
      ans++;
      erase(t.first);
      erase(t.second);
    }
  }
  while (bad.size()) {
    ans++;
    erase(a[2]);
    if (!erase(a[1]))
      erase(a[0] + a[1]);
    else
      erase(a[0]);
  }
  cout << ans << endl;
  return 0;
}
