#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
ostream& operator<<(ostream& os, const pair<T1, T2>& p) {
  return os << '(' << p.first << ',' << p.second << ')';
}
template <typename Tuple>
void print_tuple(ostream&, const Tuple&) {}
template <typename Car, typename... Cdr, typename Tuple>
void print_tuple(ostream& os, const Tuple& t) {
  print_tuple<Cdr...>(os, t);
  os << (sizeof...(Cdr) ? "," : "") << get<sizeof...(Cdr)>(t);
}
template <typename... Args>
ostream& operator<<(ostream& os, const tuple<Args...>& t) {
  print_tuple<Args...>(os << '(', t);
  return os << ')';
}
template <typename Ch, typename Tr, typename C>
basic_ostream<Ch, Tr>& operator<<(basic_ostream<Ch, Tr>& os, const C& c) {
  os << '[';
  for (auto i = begin(c); i != end(c); ++i)
    os << (i == begin(c) ? "" : " ") << *i;
  return os << ']';
}
constexpr int INF = 1e9;
constexpr int MOD = 1e9 + 7;
constexpr double EPS = 1e-9;
int main() {
  for (int n; cin >> n && n;) {
    int a, b, c;
    {
      vector<int> ms(3);
      for (int i = int(0); i < int(3); i++) cin >> ms[i];
      sort(begin(ms), end(ms));
      a = ms[0], b = ms[1], c = ms[2];
    }
    map<int, int, greater<int>> f;
    {
      vector<int> ts(n);
      for (int i = int(0); i < int(n); i++) cin >> ts[i];
      sort(begin(ts), end(ts), greater<int>());
      for (int i = int(0); i < int(n); i++) f[ts[i]]++;
    }
    if (f.begin()->first > a + b + c) {
      cout << -1 << endl;
      continue;
    }
    int res = 0;
    for (;;) {
      auto i = f.lower_bound(a + b + c), j = f.lower_bound(b + c);
      if (i == j) break;
      if (--i->second == 0) f.erase(i);
      res++;
    }
    for (;;) {
      auto i = f.lower_bound(b + c), j = f.lower_bound(a + c);
      if (i == j) break;
      if (--i->second == 0) f.erase(i);
      auto k = f.lower_bound(a);
      if (k != end(f) && --k->second == 0) f.erase(k);
      res++;
    }
    for (;;) {
      auto i = f.lower_bound(a + c), j = f.lower_bound(max(a + b, c));
      if (i == j) break;
      if (--i->second == 0) f.erase(i);
      auto k = f.lower_bound(b);
      if (k != end(f) && --k->second == 0) f.erase(k);
      res++;
    }
    if (a + b > c) {
      for (;;) {
        auto i = f.lower_bound(a + b), j = f.lower_bound(c);
        if (i == j) break;
        if (--i->second == 0) f.erase(i);
        auto k = f.lower_bound(c);
        if (k != end(f) && --k->second == 0) f.erase(k);
        res++;
      }
    }
    for (;;) {
      auto i = f.lower_bound(c);
      if (i == end(f)) break;
      if (--i->second == 0) f.erase(i);
      auto j = f.lower_bound(b);
      if (j == end(f)) {
        j = f.lower_bound(a + b);
        if (j != end(f) && --j->second == 0) f.erase(j);
      } else {
        if (--j->second == 0) f.erase(j);
        auto k = f.lower_bound(a);
        if (k != end(f) && --k->second == 0) f.erase(k);
      }
      res++;
    }
    for (auto i : f) res += i.second;
    cout << res << endl;
  }
}
