#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200005;
int N, A[3], T[MAXN], abc, bc, ac, c, ab;
int main() {
  cin >> N >> A[0] >> A[1] >> A[2];
  for (int i = 0; i < N; i++) {
    cin >> T[i];
  }
  sort(A, A + 3);
  sort(T, T + N);
  int l = N - 1;
  if (T[l] > A[0] + A[1] + A[2]) {
    cout << -1 << '\n';
    return 0;
  }
  while (l >= 0 && T[l] > A[1] + A[2]) {
    assert(T[l] <= A[0] + A[1] + A[2]);
    abc += 1;
    l -= 1;
  }
  while (l >= 0 && T[l] > A[0] + A[2]) {
    assert(T[l] <= A[1] + A[2]);
    bc += 1;
    l -= 1;
  }
  if (A[2] >= A[0] + A[1]) {
    while (l >= 0 && T[l] > A[2]) {
      assert(T[l] <= A[0] + A[2]);
      ac += 1;
      l -= 1;
    }
    while (l >= 0 && T[l] > A[0] + A[1]) {
      assert(T[l] <= A[2]);
      c += 1;
      l -= 1;
    }
  } else {
    while (l >= 0 && T[l] > A[0] + A[1]) {
      assert(T[l] <= A[0] + A[2]);
      ac += 1;
      l -= 1;
    }
    while (l >= 0 && T[l] > A[2]) {
      assert(T[l] <= A[0] + A[1]);
      ab += 1;
      l -= 1;
    }
  }
  int fml = 0;
  while (l >= 0 && T[l] > A[1]) {
    assert(T[l] <= A[2] && T[l] <= A[0] + A[1]);
    if (ab > 0)
      ab -= 1, abc += 1;
    else if (c > 0)
      c -= 1, abc += 1, fml += 1;
    else
      c += 1;
    l -= 1;
  }
  while (l >= 0 && T[l] > A[0]) {
    if (ac > 0)
      ac -= 1, abc += 1;
    else if (ab > 0)
      ab -= 1, abc += 1;
    else if (c > 0)
      c -= 1, bc += 1;
    else if (fml > 0)
      fml -= 1, abc -= 1, c += 1, bc += 1;
    else
      c += 1;
    l -= 1;
  }
  while (l >= 0 && T[l] > 0) {
    if (bc > 0)
      bc -= 1, abc += 1;
    else if (c > 0)
      c -= 1, ac += 1;
    else if (ac > 0)
      ac -= 1, abc += 1;
    else if (ab > 0)
      ab -= 1, abc += 1;
    else if (fml > 0)
      fml -= 1, abc -= 1, c += 1, bc += 1;
    else
      c += 1;
    l -= 1;
  }
  assert(l == -1);
  assert(ab == 0 || c == 0);
  cout << abc + ab + ac + bc + c << '\n';
}
