#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
const int MOD = 1e9 + 7;
vector<int> v[5];
multiset<int> st;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int a, b, c;
  cin >> a >> b >> c;
  v[0].push_back(a);
  v[0].push_back(b);
  v[0].push_back(c);
  v[1].push_back(a + b + c);
  v[2].push_back(a + b);
  v[2].push_back(c);
  v[3].push_back(a + c);
  v[3].push_back(b);
  v[4].push_back(b + c);
  v[4].push_back(a);
  for (int i = 0; i < 5; i++) sort(v[i].begin(), v[i].end(), greater<int>());
  sort(v, v + 5);
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    st.insert(t);
  }
  bool flag = true;
  int ans = 0;
  while (st.size()) {
    auto it = st.end();
    it--;
    int val = *it;
    st.erase(it);
    flag = false;
    for (int i = 0; i < 5; i++)
      if (v[i][0] >= val) {
        flag = true;
        bool ok = true;
        vector<int> tmp;
        for (int j = 1; j < v[i].size(); j++) {
          auto jt = st.upper_bound(v[i][j]);
          if (jt == st.begin()) {
            ok = false;
            break;
          }
          jt--;
          tmp.push_back(*jt);
          st.erase(jt);
        }
        if (!ok) {
          for (int i = 0; i < tmp.size(); i++) st.insert(tmp[i]);
          continue;
        }
        ans++;
        break;
      }
    if (!flag) {
      cout << "-1\n";
      return 0;
    }
  }
  if (!flag)
    cout << "-1\n";
  else
    cout << ans << "\n";
  return 0;
}
