#include <bits/stdc++.h>
using namespace std;
int s[200005];
pair<int, pair<int, int> > sen[200005];
map<int, int> m;
void dec(int val) {
  if (val <= 0) return;
  m[val]--;
  if (m[val] <= 0) m.erase(val);
}
void inc(int val) { m[val]++; }
int popMax() {
  map<int, int>::iterator it = m.end();
  --it;
  int ret = it->first;
  dec(ret);
  return ret;
}
int getFirstLower(int val) {
  map<int, int>::iterator it = m.upper_bound(val);
  if (it == m.begin()) return -1;
  --it;
  return it->first;
}
int sum(pair<int, int> &x) { return x.first + x.second; }
int main() {
  ios::sync_with_stdio(false);
  int n;
  scanf("%d", &n);
  int a, b, c;
  scanf("%d%d%d", &a, &b, &c);
  for (int i = 0; i < 3; i++) {
    if (b > c) swap(b, c);
    if (a > b) swap(a, b);
    if (a > c) swap(a, c);
  }
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    inc(x);
  }
  sen[0] = make_pair(0, make_pair(0, a + b + c));
  sen[1] = make_pair(0, make_pair(min(c, a + b), max(c, a + b)));
  sen[2] = make_pair(0, make_pair(min(b, a + c), max(b, a + c)));
  sen[3] = make_pair(0, make_pair(min(a, b + c), max(a, b + c)));
  sen[4] = make_pair(a, make_pair(b, c));
  int ans = 0;
  while (!m.empty()) {
    ans += 1;
    int x = popMax();
    int numBonus = -1;
    pair<int, int> vals = make_pair(-1, -1);
    for (int k = 0; k < 5; k++) {
      int a = sen[k].first, b = sen[k].second.first, c = sen[k].second.second;
      if (c < x) continue;
      int curNumBonus = 0;
      pair<int, int> curVals = make_pair(0, 0);
      int toBeRemovedByB = getFirstLower(b);
      if (toBeRemovedByB != -1)
        dec(toBeRemovedByB), curNumBonus++, curVals.first = toBeRemovedByB;
      int toBeRemovedByA = getFirstLower(a);
      if (toBeRemovedByA != -1) curNumBonus++, curVals.second = toBeRemovedByA;
      if (toBeRemovedByB != -1) inc(toBeRemovedByB);
      if (curNumBonus > numBonus)
        numBonus = curNumBonus, vals = curVals;
      else if (curNumBonus == numBonus && sum(vals) < sum(curVals))
        numBonus = curNumBonus, vals = curVals;
    }
    if (numBonus == -1) {
      puts("-1");
      return 0;
    }
    dec(vals.first);
    dec(vals.second);
  }
  cout << ans << endl;
  return 0;
}
