#include <bits/stdc++.h>
using namespace std;
int N, a, b, c;
multiset<int> st;
multiset<int>::iterator it, it2;
void rmv(int x) {
  if (st.empty()) return;
  it = st.upper_bound(x);
  if (it == st.begin()) return;
  it--;
  st.erase(it);
}
void rmv(int x, int y) {
  if (st.empty()) return;
  int cr_val;
  it = st.upper_bound(x);
  it2 = st.upper_bound(y);
  if (it == st.begin() || it2 == st.begin())
    rmv(x + y);
  else {
    it2--;
    cr_val = *it2;
    st.erase(it2);
    it = st.upper_bound(x);
    if (it == st.begin()) {
      st.insert(cr_val);
      rmv(x + y);
    } else {
      it--;
      st.erase(it);
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> N;
  cin >> a >> b >> c;
  if (a > b) swap(a, b);
  if (b > c) swap(b, c);
  if (a > b) swap(a, b);
  int i, res = 0, val1, x;
  for (i = 1; i <= N; i++) {
    cin >> x;
    st.insert(x);
  }
  while (!st.empty()) {
    res++;
    it = st.end();
    it--;
    val1 = *it;
    st.erase(it);
    if (val1 <= c) {
      if (val1 <= a)
        rmv(b, c);
      else if (val1 <= b)
        rmv(a, c);
      else
        rmv(a, b);
    } else if (val1 <= a + b)
      rmv(c);
    else if (val1 <= a + c)
      rmv(b);
    else if (val1 <= b + c)
      rmv(a);
    if (val1 > a + b + c) {
      cout << -1 << "\n";
      return 0;
    }
  }
  cout << res << "\n";
  return 0;
}
