#include <bits/stdc++.h>
using namespace std;
int n, X[3];
int T[300000];
int A, B, ABoC, C, AB, AC, BC, ABC;
int solve() {
  int i, j, k, res, tmp;
  int a, b, c;
  for (int i = (0), _b = (n); i < _b; ++i) {
    if (T[i] > X[0] + X[1] + X[2]) return -1;
    if (T[i] <= X[0]) {
      A++;
      continue;
    }
    if (T[i] <= X[1]) {
      B++;
      continue;
    }
    if (T[i] <= X[2] && T[i] <= X[0] + X[1]) {
      ABoC++;
      continue;
    }
    if (T[i] <= X[2]) {
      C++;
      continue;
    }
    if (T[i] <= X[0] + X[1]) {
      AB++;
      continue;
    }
    if (T[i] <= X[0] + X[2]) {
      AC++;
      continue;
    }
    if (T[i] <= X[1] + X[2]) {
      BC++;
      continue;
    }
    ABC++;
  }
  res = n;
  for (int k = (0), _b = (ABoC); k <= _b; ++k) {
    C += k;
    AB += ABoC - k;
    tmp = ABC;
    a = A;
    b = B;
    c = C;
    tmp += BC;
    a -= min(BC, a);
    tmp += AC;
    i = AC;
    j = min(i, b);
    b -= j;
    i -= j;
    j = min(i, a);
    a -= j;
    tmp += AB;
    i = AB;
    j = min(i, c);
    c -= j;
    i -= j;
    j = min(i, b);
    b -= j;
    i -= j;
    j = min(i, a);
    a -= j;
    tmp += max(c, max((c + b + 1) / 2, (c + b + a + 2) / 3));
    res = min(res, tmp);
    C -= k;
    AB -= ABoC - k;
  }
  return res;
}
int main() {
  scanf("%d", &n);
  for (int i = (0), _b = (3); i < _b; ++i) scanf("%d", &X[i]);
  for (int i = (0), _b = (n); i < _b; ++i) scanf("%d", &T[i]);
  sort(X, X + 3);
  printf("%d", solve());
  return 0;
}
