#include <bits/stdc++.h>
using namespace std;
multiset<int> s;
int n, ans, c[3];
bool del(int x) {
  auto i = s.lower_bound(-x);
  if (i == s.end()) return 0;
  return s.erase(i), 1;
}
int gt() { return -*s.begin(); }
int main() {
  cin >> n >> c[0] >> c[1] >> c[2], sort(c, c + 3);
  for (int i = 0, x; i < n; i++) cin >> x, s.insert(-x);
  if (gt() > c[0] + c[1] + c[2]) return cout << -1, 0;
  while (gt() > c[1] + c[2]) del(c[0] + c[1] + c[2]), ans++;
  while (gt() > c[0] + c[2]) del(c[2] + c[1]), del(c[0]), ans++;
  while (gt() > c[0] + c[1] && gt() > c[2]) del(c[0] + c[2]), del(c[1]), ans++;
  while (c[0] + c[1] > c[2] && gt() > c[2]) del(c[0] + c[1]), del(c[2]), ans++;
  while (del(c[1])) del(c[0]), del(c[2]), ans++;
  while (s.size()) del(c[0] + c[1]), del(c[2]), ans++;
  cout << ans;
}
