#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200005;
int N, A[3];
int sum, B[3];
multiset<int> T;
bool check1(int t) {
  if (T.empty()) return true;
  for (int i = 0; i < 3; i++)
    if (A[i] >= t) {
      multiset<int>::iterator it1 = T.upper_bound(A[(i + 1) % 3]);
      multiset<int>::iterator it2 = T.upper_bound(A[(i + 2) % 3]);
      if (it1 == T.begin() || it2 == T.begin()) continue;
      if (it1 == ++T.begin() && it2 == ++T.begin()) continue;
      T.erase(--it1);
      T.erase(--T.upper_bound(A[(i + 2) % 3]));
      return true;
    }
  for (int i = 0; i < 3; i++)
    if (A[i] >= t) {
      if (!T.empty()) {
        multiset<int>::iterator it = T.upper_bound(sum - A[i]);
        if (it != T.begin()) T.erase(--it);
      }
      return true;
    }
  return false;
}
bool check2(int t) {
  for (int i = 0; i < 3; i++)
    if (B[i] >= t) {
      if (!T.empty()) {
        multiset<int>::iterator it = T.upper_bound(sum - B[i]);
        if (it != T.begin()) T.erase(--it);
      }
      return true;
    }
  return false;
}
int main() {
  ios::sync_with_stdio(0);
  cin >> N >> A[0] >> A[1] >> A[2];
  for (int i = 0, t; i < N; i++) {
    cin >> t;
    T.insert(t);
  }
  sort(A, A + 3);
  sum = A[0] + A[1] + A[2];
  B[0] = A[0] + A[1];
  B[1] = A[0] + A[2];
  B[2] = A[1] + A[2];
  int ans = 0;
  while (!T.empty()) {
    int t = *T.rbegin();
    T.erase(--T.end());
    if (sum < t) {
      cout << "-1\n";
      return 0;
    }
    if (check1(t))
      ans++;
    else if (check2(t))
      ans++;
    else
      ans++;
  }
  cout << ans << "\n";
  return 0;
}
