#include <bits/stdc++.h>
using namespace std;
int N, s[3];
multiset<int> q;
multiset<int>::iterator it, itt;
void cikart(int a) {
  if (q.empty()) return;
  it = q.lower_bound(-a);
  if (it != q.end()) q.erase(it);
}
int main() {
  int x, ans = 0;
  cin >> N;
  cin >> s[0] >> s[1] >> s[2];
  for (int i = 1; i <= N; i++) {
    scanf("%d", &x);
    q.insert(-x);
    if (x > s[0] + s[1] + s[2]) {
      puts("-1");
      return 0;
    }
  }
  sort(s, s + 3);
  while (!q.empty()) {
    ans++;
    int p = -(*q.begin());
    q.erase(q.begin());
    if (s[2] >= p) {
      it = q.lower_bound(-s[1]);
      if (it != q.end()) it++;
      if (it == q.end()) {
        cikart(s[0] + s[1]);
        continue;
      }
      it = q.lower_bound(-s[0]);
      if (it == q.end()) {
        cikart(s[0] + s[1]);
        continue;
      }
      cikart(s[0]);
      cikart(s[1]);
    } else if (s[0] + s[1] >= p)
      cikart(s[2]);
    else if (s[0] + s[2] >= p)
      cikart(s[1]);
    else if (s[1] + s[2] >= p)
      cikart(s[0]);
  }
  printf("%d\n", ans);
  return 0;
}
