#include <bits/stdc++.h>
using namespace std;
multiset<int> s;
void f(int x) {
  auto it = s.upper_bound(x);
  if (it != s.begin()) {
    --it;
    s.erase(it);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, a, b, c;
  cin >> n >> a >> b >> c;
  if (a > b) swap(a, b);
  if (b > c) swap(b, c);
  if (a > b) swap(a, b);
  while (n--) {
    int t;
    cin >> t;
    s.insert(t);
    if (t > a + b + c) cout << -1, exit(0);
  }
  int ans = 0;
  while (s.upper_bound(b + c) != s.end()) {
    f(a + b + c);
    ans++;
  }
  while (s.upper_bound(a + c) != s.end()) {
    f(b + c);
    f(a);
    ans++;
  }
  while (s.upper_bound(max(a + b, c)) != s.end()) {
    f(a + c);
    f(b);
    ans++;
  }
  while (s.upper_bound(c) != s.end()) {
    f(a + b);
    f(c);
    ans++;
  }
  while (!s.empty()) {
    f(c);
    auto it = s.upper_bound(a);
    if (it == s.begin())
      f(a + b);
    else
      f(a), f(b);
    ans++;
  }
  cout << ans;
  return 0;
}
