#include <bits/stdc++.h>
using namespace std;
const int OO = 1000 << 20;
template <class T>
void dumpBetween(const T& a, const T& b) {
  for (T it = a; it != b; it++) cout << *it << " ";
  cout << endl;
}
template <class T>
void dumpAll(const T& a) {
  dumpBetween((a).begin(), (a).end());
}
template <class T>
void minify(T& a, const T& b) {
  if (a > b) a = b;
}
template <class T>
void maxify(T& a, const T& b) {
  if (a < b) a = b;
}
int a, b, c;
int n;
int h[7];
void burn(int i, int cnt) {
  for (int j = i; j >= 0; j--) {
    int x = min(h[j], cnt);
    h[j] -= x;
    cnt -= x;
  }
}
int solve() {
  int ans = 0;
  vector<int> abcs;
  scanf("%d", &(n));
  for (int _74 = 0; _74 < ((int)3); _74++) {
    int x;
    scanf("%d", &(x));
    abcs.push_back(x);
  }
  sort((abcs).begin(), (abcs).end());
  a = abcs[0];
  b = abcs[1];
  c = abcs[2];
  vector<int> thresholds;
  thresholds.push_back(a);
  thresholds.push_back(b);
  thresholds.push_back(c);
  thresholds.push_back(a + b);
  thresholds.push_back(a + c);
  thresholds.push_back(b + c);
  thresholds.push_back(a + b + c);
  thresholds.push_back(OO);
  sort((thresholds).begin(), (thresholds).end());
  for (int _93 = 0; _93 < ((int)n); _93++) {
    int x;
    scanf("%d", &(x));
    for (size_t i = 0; i < 8; i++) {
      if (x <= thresholds[i]) {
        if (i == 7) return -1;
        h[i]++;
        break;
      }
    }
  }
  ((void)0);
  ans += h[6];
  h[6] = 0;
  ans += h[5];
  burn(0, h[5]);
  h[5] = 0;
  ans += h[4];
  burn(1, h[4]);
  h[4] = 0;
  int rans = OO;
  int w = h[0], x = h[1], y = h[2], z = h[3];
  if (a + b > c) {
    ((void)0);
    for (int s = 0; s < ((int)w + x + y + z + 1); s++) {
      int t = max(
          z, max((z + y - s + 1) / 2, max((z + y + x - 2 * s + 1) / 2,
                                          (z + y + x + w - 3 * s + 1) / 2)));
      minify(rans, s + t);
    }
  } else {
    ((void)0);
    for (int s = 0; s < ((int)w + x + y + z + 1); s++) {
      int t = max(0, max(z - s, max((z + y - s + 1) / 2,
                                    max((z + y + x - 2 * s + 1) / 2,
                                        (z + y + x + w - 3 * s + 1) / 2))));
      minify(rans, s + t);
    }
  }
  return ans + rans;
}
void tc() { printf("%d\n", solve()); }
int main() { tc(); }
