#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
multiset<int> s;
bool dell(int x) {
  auto pos = s.lower_bound(-x);
  if (pos == s.end()) return false;
  s.erase(pos);
  return true;
}
int gt() { return -*s.begin(); }
int main() {
  int n, c[3];
  cin >> n >> c[0] >> c[1] >> c[2];
  sort(c, c + 3);
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a), s.insert(-a);
  }
  if (c[0] + c[1] + c[2] < gt()) {
    cout << -1 << endl;
    return 0;
  }
  int ans = 0;
  while (gt() > c[1] + c[2]) dell(c[0] + c[1] + c[2]), ans++;
  while (gt() > c[0] + c[2]) dell(c[1] + c[2]), dell(c[0]), ans++;
  while (gt() > c[0] + c[1] && c[2] < gt())
    dell(c[0] + c[2]), dell(c[1]), ans++;
  while (c[2] < gt() && c[0] + c[1] > c[2])
    dell(c[0] + c[1]), dell(c[2]), ans++;
  while (dell(c[1])) dell(c[2]), dell(c[0]), ans++;
  while (s.size()) dell(c[0] + c[1]), dell(c[2]), ans++;
  cout << ans << endl;
}
