#include <bits/stdc++.h>
using namespace std;
int n, sol;
int x, a, b, c, v[4];
multiset<int, greater<int>> s;
multiset<int> t;
int main() {
  cin.sync_with_stdio(false);
  cin >> n;
  cin >> v[1] >> v[2] >> v[3];
  sort(v + 1, v + 4);
  a = v[1];
  b = v[2];
  c = v[3];
  for (int i = 1; i <= n; i++) {
    cin >> x;
    s.insert(x);
    t.insert(x);
  }
  while (!s.empty()) {
    sol++;
    x = *s.begin();
    s.erase(s.find(x));
    t.erase(t.find(x));
    if (x > a + b + c) {
      cout << -1;
      return 0;
    }
    if (a >= x) {
      int ok = 0;
      int mlc1 = 0, mlc2 = 0;
      auto it = t.upper_bound(b);
      if (it != t.begin()) {
        ok++;
        it--;
        mlc1 = *it;
        t.erase(t.find(*it));
        s.erase(s.find(*it));
      }
      it = t.upper_bound(c);
      if (it != t.begin()) {
        ok++;
        it--;
        mlc2 = *it;
        t.erase(t.find(*it));
        s.erase(s.find(*it));
      }
      if (ok < 2) {
        if (mlc1) {
          t.insert(mlc1);
          s.insert(mlc1);
        }
        if (mlc2) {
          t.insert(mlc2);
          s.insert(mlc2);
        }
        it = t.upper_bound(b + c);
        if (it != t.begin()) {
          it--;
          t.erase(t.find(*it));
          ;
          s.erase(s.find(*it));
        }
      }
    } else if (b >= x) {
      int ok = 0;
      int mlc1 = 0, mlc2 = 0;
      auto it = t.upper_bound(a);
      if (it != t.begin()) {
        ok++;
        it--;
        mlc1 = *it;
        t.erase(t.find(*it));
        s.erase(s.find(*it));
      }
      it = t.upper_bound(c);
      if (it != t.begin()) {
        ok++;
        it--;
        mlc2 = *it;
        t.erase(t.find(*it));
        s.erase(s.find(*it));
      }
      if (ok < 2) {
        if (mlc1) {
          t.insert(mlc1);
          s.insert(mlc1);
        }
        if (mlc2) {
          t.insert(mlc2);
          s.insert(mlc2);
        }
        it = t.upper_bound(a + c);
        if (it != t.begin()) {
          it--;
          t.erase(t.find(*it));
          s.erase(s.find(*it));
        }
      }
    } else if (c >= x) {
      int ok = 0;
      int mlc1 = 0, mlc2 = 0;
      auto it = t.upper_bound(a);
      if (it != t.begin()) {
        ok++;
        it--;
        mlc1 = *it;
        t.erase(t.find(*it));
        s.erase(s.find(*it));
      }
      it = t.upper_bound(b);
      if (it != t.begin()) {
        ok++;
        it--;
        mlc2 = *it;
        t.erase(t.find(*it));
        s.erase(s.find(*it));
      }
      if (ok < 2) {
        if (mlc1) {
          t.insert(mlc1);
          s.insert(mlc1);
        }
        if (mlc2) {
          t.insert(mlc2);
          s.insert(mlc2);
        }
        it = t.upper_bound(a + b);
        if (it != t.begin()) {
          it--;
          t.erase(t.find(*it));
          s.erase(s.find(*it));
        }
      }
    } else if (a + b >= x) {
      auto it = t.upper_bound(c);
      if (it != t.begin()) {
        it--;
        t.erase(t.find(*it));
        s.erase(s.find(*it));
      }
    } else if (a + c >= x) {
      auto it = t.upper_bound(b);
      if (it != t.begin()) {
        it--;
        t.erase(t.find(*it));
        s.erase(s.find(*it));
      }
    } else if (b + c >= x) {
      auto it = t.upper_bound(a);
      if (it != t.begin()) {
        it--;
        t.erase(t.find(*it));
        s.erase(s.find(*it));
      }
    }
  }
  cout << sol;
  return 0;
}
