#include <bits/stdc++.h>
using namespace std;
int N, a, b, c, tmp, sol, ite;
multiset<int> asdf;
multiset<int>::iterator it, it2;
int main() {
  scanf("%d%d%d%d", &N, &a, &b, &c);
  for (int i = 1; i <= N; i++) scanf("%d", &tmp), asdf.insert(tmp);
  if (*(--asdf.end()) > a + b + c) {
    puts("-1");
    return 0;
  }
  if (b < a) swap(a, b);
  if (c < b) swap(c, b);
  if (b < a) swap(a, b);
  while (!asdf.empty()) {
    ite = *(--asdf.end());
    if (ite > c + b) {
      sol++;
      asdf.erase(--asdf.end());
      continue;
    }
    break;
  }
  while (!asdf.empty()) {
    ite = *(--asdf.end());
    if (ite <= a + c) break;
    sol++;
    asdf.erase(--asdf.end());
    it = asdf.upper_bound(a);
    if (it == asdf.begin()) continue;
    it--;
    asdf.erase(it);
  }
  while (!asdf.empty()) {
    ite = *(--asdf.end());
    if (ite <= a + b || ite <= c) break;
    sol++;
    asdf.erase(--asdf.end());
    it = asdf.upper_bound(b);
    if (it == asdf.begin()) continue;
    it--;
    asdf.erase(it);
  }
  if (a + b > c)
    while (!asdf.empty()) {
      ite = *(--asdf.end());
      if (ite <= c) break;
      sol++;
      asdf.erase(--asdf.end());
      it = asdf.upper_bound(c);
      if (it == asdf.begin()) continue;
      it--;
      asdf.erase(it);
    }
  while (!asdf.empty()) {
    ite = *(--asdf.end());
    sol++;
    asdf.erase(--asdf.end());
    it = asdf.upper_bound(b);
    if (it != asdf.begin()) {
      asdf.erase(--it);
      it2 = asdf.upper_bound(a);
      if (it2 != asdf.begin()) asdf.erase(--it2);
      continue;
    }
    it = asdf.upper_bound(a + b);
    if (it != asdf.begin()) {
      asdf.erase(--it);
    }
  }
  printf("%d", sol);
  return 0;
}
