#include <bits/stdc++.h>
int N, w[3], cnt[7], O, tmp, d = 1000000000;
int main() {
  scanf("%d%d%d%d", &N, w, w + 1, w + 2);
  std::sort(w, w + 3);
  while (N--) {
    int x;
    scanf("%d", &x);
    if (x <= w[0])
      cnt[0]++;
    else if (x <= w[1])
      cnt[1]++;
    else if (x <= std::min(w[2], w[0] + w[1]))
      cnt[2]++;
    else if (x <= std::max(w[2], w[0] + w[1]))
      cnt[3]++;
    else if (x <= w[0] + w[2])
      cnt[4]++;
    else if (x <= w[1] + w[2])
      cnt[5]++;
    else if (x <= w[0] + w[1] + w[2])
      cnt[6]++;
    else {
      puts("-1");
      return 0;
    }
  }
  O = cnt[4] + cnt[5] + cnt[6];
  cnt[1] -= tmp = std::min(cnt[1], cnt[4]);
  cnt[4] -= tmp;
  cnt[0] = std::max(0, cnt[0] - cnt[4] - cnt[5]);
  cnt[4] = cnt[5] = cnt[6] = 0;
  if (w[2] < w[0] + w[1])
    for (int i = 0; i <= cnt[2]; i++) {
      int c0 = cnt[0], c1 = cnt[1], c2 = cnt[2] - i, res = cnt[3] + i;
      res -= tmp = std::min(c2, res);
      c2 -= tmp;
      res -= tmp = std::min(c1, res);
      c1 -= tmp;
      res -= tmp = std::min(c0, res);
      c0 -= tmp;
      d = std::min(d, cnt[3] + i +
                          std::max(std::max(c2, (c1 + c2 + 1) / 2),
                                   (c0 + c1 + c2 + 2) / 3));
    }
  else
    for (int i = 0; i <= cnt[2]; i++) {
      int c0 = cnt[0], c1 = cnt[1], c2 = cnt[2] + cnt[3] - i, res = i;
      res -= tmp = std::min(c2, res);
      c2 -= tmp;
      res -= tmp = std::min(c1, res);
      c1 -= tmp;
      res -= tmp = std::min(c0, res);
      c0 -= tmp;
      d = std::min(d, i + std::max(std::max(c2, (c1 + c2 + 1) / 2),
                                   (c0 + c1 + c2 + 2) / 3));
    }
  printf("%d\n", O + d);
  return 0;
}
