#include <bits/stdc++.h>
using namespace std;
int n, arr[3], ans, a, b, c, ma, t;
multiset<int> s;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < 3; i++) scanf("%d", arr + i);
  for (int i = 0; i < n; i++) {
    scanf("%d", &t);
    s.insert(t);
    ma = max(t, ma);
  }
  sort(arr, arr + 3);
  a = arr[0];
  b = arr[1];
  c = arr[2];
  if (a + b + c < ma) return 0 * printf("-1\n");
  multiset<int>::iterator now, it = s.upper_bound(b + c);
  while (it != s.end()) s.erase(it++), ans++;
  it = s.upper_bound(a + c);
  while (it != s.end()) {
    ans++;
    s.erase(it++);
    now = s.upper_bound(a);
    now--;
    if (now != s.end()) s.erase(now);
  }
  it = s.upper_bound(max(a + b, c));
  while (it != s.end()) {
    ans++;
    s.erase(it++);
    now = s.upper_bound(b);
    now--;
    if (now != s.end()) s.erase(now);
  }
  if (a + b > c) {
    now = it = s.upper_bound(c);
    now--;
    while (it != s.end()) {
      ans++;
      s.erase(it++);
      if (now != s.end()) s.erase(now--);
    }
  }
  while (!s.empty()) {
    ans++;
    it = s.end();
    it--;
    s.erase(it);
    if (s.empty()) break;
    now = s.upper_bound(b);
    now--;
    if (now != s.end() && b >= *now) {
      s.erase(now);
      if (s.empty()) break;
      now = s.upper_bound(a);
      now--;
      if (now != s.end() && a >= *now) s.erase(now);
    } else {
      now = s.upper_bound(a + b);
      now--;
      if (now != s.end() && a + b >= *now) s.erase(now);
    }
  }
  printf("%d\n", ans);
  return 0;
}
