#include <bits/stdc++.h>
using namespace std;
int n, i, a, b, c, v[200100], ans, x, y;
multiset<int>::iterator it;
multiset<int> s;
int main() {
  scanf("%d", &n);
  scanf("%d%d%d", &a, &b, &c);
  for (i = 0; i < n; i++) scanf("%d", &v[i]);
  sort(v, v + n);
  if (a > b) swap(a, b);
  if (a > c) swap(a, c);
  if (b > c) swap(b, c);
  if (a + b + c < v[n - 1]) {
    puts("-1");
    return 0;
  }
  while (n > 0 && v[n - 1] > b + c) {
    ans++;
    n--;
  }
  for (i = 0; i < n; i++) s.insert(-v[i]);
  while (s.size()) {
    ans++;
    it = s.begin();
    x = -*it;
    s.erase(it);
    if (x <= c) {
      it = s.lower_bound(-a);
      if (it != s.end()) {
        y = *it;
        s.erase(it);
        it = s.lower_bound(-b);
        if (it != s.end()) {
          s.erase(it);
          continue;
        }
        s.insert(y);
      }
      it = s.lower_bound(-a - b);
      if (it != s.end()) s.erase(it);
    } else {
      if (x <= a + b)
        y = c;
      else if (x <= a + c)
        y = b;
      else
        y = a;
      it = s.lower_bound(-y);
      if (it != s.end()) s.erase(it);
    }
  }
  printf("%d\n", ans);
  return 0;
}
