#include <bits/stdc++.h>
using namespace std;
int n, q[3], v[200000];
void eraseBest(multiset<int> &s, int p) {
  multiset<int>::iterator it;
  it = s.upper_bound(p);
  if (it == s.begin()) return;
  s.erase(--it);
}
bool check(multiset<int> s, int m) {
  for (int i = 0; i < m; ++i) eraseBest(s, q[2]);
  while (!s.empty()) {
    --m;
    if (m == -1) return false;
    int mx = *--s.end();
    if (mx <= q[1]) {
      eraseBest(s, q[1]);
      eraseBest(s, q[0]);
    } else if (q[0] + q[1] >= mx)
      s.erase(--s.end());
    else
      return false;
  }
  return true;
}
int main() {
  scanf("%d%d%d%d", &n, q + 0, q + 1, q + 2);
  sort(q, q + 3);
  int res = 0;
  for (int i = 0; i < n; ++i) {
    scanf("%d", v + i);
    if (q[0] + q[1] + q[2] < v[i]) {
      puts("-1");
      return 0;
    }
    if (q[1] + q[2] < v[i]) {
      ++res;
      --i;
      --n;
      continue;
    }
  }
  multiset<int> s;
  multiset<int>::iterator it;
  multiset<int>::iterator jt;
  for (int i = 0; i < n; ++i) s.insert(v[i]);
  for (it = s.begin(); it != s.end();) {
    if (*it > q[2]) {
      int mx = 0;
      for (int i = 0; i < 3; ++i)
        for (int j = i + 1; j < 3; ++j)
          if (q[i] + q[j] >= *it)
            mx = max(mx, q[0] + q[1] + q[2] - q[i] - q[j]);
      int z = *it;
      s.erase(it);
      eraseBest(s, mx);
      it = s.lower_bound(z);
      ++res;
    } else
      ++it;
  }
  int l = 0, r = s.size(), m, best = s.size();
  while (l <= r) {
    m = (l + r) / 2;
    if (check(s, m)) {
      best = m;
      r = m - 1;
    } else
      l = m + 1;
  }
  printf("%d\n", res + best);
  return 0;
}
