#include <bits/stdc++.h>
using namespace std;
multiset<int> st;
multiset<int>::iterator it;
int arr[200000];
int main() {
  int n, i, a, b, c, ans = 0, temp[3];
  scanf("%d", &n);
  scanf("%d", &temp[0]);
  scanf("%d", &temp[1]);
  scanf("%d", &temp[2]);
  sort(temp, temp + 3);
  a = temp[0];
  b = temp[1];
  c = temp[2];
  for (i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
    st.insert(-arr[i]);
  }
  for (i = 0; i < n; i++)
    if (arr[i] > a + b + c) {
      printf("-1\n");
      return 0;
    }
  while (!st.empty()) {
    it = st.lower_bound(-1 * (a + b + c));
    if (it == st.end() or -1 * (*it) <= (b + c)) break;
    st.erase(it);
    ans++;
  }
  while (!st.empty()) {
    it = st.lower_bound(-1 * (b + c));
    if (it == st.end() or -1 * (*it) <= (a + c)) break;
    st.erase(it);
    it = st.lower_bound(-1 * (a));
    if (it != st.end()) st.erase(it);
    ans++;
  }
  while (!st.empty()) {
    it = st.lower_bound(-1 * (a + c));
    if (it == st.end() or -1 * (*it) <= (max(a + b, c))) break;
    st.erase(it);
    it = st.lower_bound(-1 * (b));
    if (it != st.end()) st.erase(it);
    ans++;
  }
  if ((a + b) > c) {
    while (!st.empty()) {
      it = st.lower_bound(-1 * (a + b));
      if (it == st.end() or -1 * (*it) <= c) break;
      st.erase(it);
      it = st.lower_bound(-1 * (c));
      if (it != st.end()) st.erase(it);
      ans++;
    }
  }
  while (!st.empty()) {
    it = st.lower_bound(-1 * (c));
    if (it == st.end()) break;
    st.erase(it);
    it = st.lower_bound(-1 * (b));
    if (it != st.end()) {
      st.erase(it);
      it = st.lower_bound(-1 * (a));
      if (it != st.end()) st.erase(it);
    } else {
      it = st.lower_bound(-1 * (a + b));
      if (it != st.end()) st.erase(it);
    }
    ans++;
  }
  printf("%d\n", ans);
  return 0;
}
