#include <bits/stdc++.h>
using namespace std;
int n, a, b, c, an, A[200005];
struct cmp {
  bool operator()(const int &a, const int &b) const {
    return A[a] ^ A[b] ? A[a] < A[b] : b < a;
  }
};
set<int, cmp> Set;
inline int IN() {
  char c;
  register int x = 0;
  for (; (c = getchar()) < 48;)
    ;
  for (; c > 47; (c = getchar())) x = x * 10 + c - 48;
  return x;
}
inline void hello() { freopen("ha.in", "r", stdin); }
inline void bye() {
  fprintf(stderr, "Ò®!\n");
  exit(0);
}
int main() {
  n = IN();
  a = IN();
  b = IN();
  c = IN();
  if (a > b) swap(a, b);
  if (a > c) swap(a, c);
  if (b > c) swap(b, c);
  for (int _r = n, i = 1; i <= _r; ++i) {
    A[i] = IN();
    Set.insert(i);
  }
  for (; Set.size();) {
    int i = *Set.rbegin();
    set<int, cmp>::iterator j;
    ++an;
    Set.erase(i);
    if (a >= A[i]) {
      if (Set.size()) Set.erase(Set.begin());
      if (Set.size()) Set.erase(Set.begin());
    } else if (b >= A[i]) {
      A[0] = a;
      j = Set.upper_bound(0);
      if (j != Set.begin()) Set.erase(--j);
      A[0] = c;
      j = Set.upper_bound(0);
      if (j != Set.begin()) Set.erase(--j);
    } else if (c >= A[i]) {
      int u = 0, v = 0;
      A[0] = a;
      j = Set.upper_bound(0);
      if (j != Set.begin()) u = *(--j), Set.erase(j);
      A[0] = b;
      j = Set.upper_bound(0);
      if (j != Set.begin()) v = *(--j), Set.erase(j);
      if (!u || !v) {
        if (u) Set.insert(u);
        if (v) Set.insert(v);
        A[0] = a + b;
        j = Set.upper_bound(0);
        if (j != Set.begin()) Set.erase(--j);
      }
    } else if (a + b >= A[i]) {
      A[0] = c;
      j = Set.upper_bound(0);
      if (j != Set.begin()) Set.erase(--j);
    } else if (a + c >= A[i]) {
      A[0] = b;
      j = Set.upper_bound(0);
      if (j != Set.begin()) Set.erase(--j);
    } else if (b + c >= A[i]) {
      A[0] = a;
      j = Set.upper_bound(0);
      if (j != Set.begin()) Set.erase(--j);
    } else if (a + b + c < A[i])
      return puts("-1"), 0;
  }
  printf("%d\n", an);
}
