#include <bits/stdc++.h>
using namespace std;
const int maxN = 200010;
int n, a, b, c;
int m[3], power, ans, best, weak;
multiset<int> p;
multiset<int>::iterator pos;
void fight(int total) {
  multiset<int>::iterator it = p.upper_bound(total);
  if (it == p.begin()) return;
  it--;
  p.erase(it);
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cin >> n;
  cin >> m[0] >> m[1] >> m[2];
  sort(m, m + 3);
  a = m[0];
  b = m[1];
  c = m[2];
  for (int i = 0; i < n; i++) {
    cin >> power;
    if (power > a + b + c) {
      cout << "-1\n";
      return 0;
    }
    if (power > b + c) {
      ans++;
      continue;
    }
    p.insert(power);
  }
  while (!p.empty()) {
    ans++;
    pos = p.end();
    pos--;
    best = *pos;
    if (a >= best || b >= best) {
      fight(a);
      fight(b);
      fight(c);
    } else if (c >= best) {
      pos = p.begin();
      weak = *pos;
      if (a >= weak) {
        fight(a);
        fight(b);
        fight(c);
      } else {
        fight(c);
        fight(a + b);
      }
    } else if (a + b >= best) {
      fight(a + b);
      fight(c);
    } else if (a + c >= best) {
      fight(a + c);
      fight(b);
    } else if (b + c >= best) {
      fight(b + c);
      fight(a);
    }
  }
  cout << ans << '\n';
  return 0;
}
