#include <bits/stdc++.h>
using namespace std;
int n;
int s[3];
int t[200000];
int cnt[7];
void cascade(int lev) {
  while (lev >= 0) {
    if (cnt[lev] > 0) {
      cnt[lev]--;
      return;
    }
  }
}
int tmv(int a, int b, int c) {
  int res = c;
  res += b;
  a = max(a - b, 0);
  res += (a + 1) / 2;
  return res;
}
int f(int a, int b, int c) {
  int l = -1;
  int r = a + b + c;
  while (l + 1 < r) {
    int m = (l + r) / 2;
    int c1 = c - m;
    int b1 = b;
    int a1 = a;
    if (c1 < 0) {
      b1 += c1;
      c1 = 0;
    }
    if (b1 < 0) {
      a1 += b1;
      b1 = 0;
    }
    if (a1 < 0) {
      a1 = 0;
    }
    if (tmv(a1, b1, c1) <= m)
      r = m;
    else
      l = m;
  }
  return r;
}
int g(int a, int b, int c, int d) {
  int l = d - 1;
  int r = a + b + c + d;
  while (l + 1 < r) {
    int m = (l + r) / 2;
    int c1 = c - (m - d);
    int b1 = b;
    int a1 = a;
    if (c1 < 0) {
      b1 += c1;
      c1 = 0;
    }
    if (b1 < 0) {
      a1 += b1;
      b1 = 0;
    }
    if (a1 < 0) {
      a1 = 0;
    }
    if (tmv(a1, b1, c1) <= m)
      r = m;
    else
      l = m;
  }
  return r;
}
void solve_testcase() {
  sort(s, s + 3);
  for (int i = 0; i < 7; i++) cnt[i] = 0;
  for (int i = 0; i < n; i++) {
    if (t[i] > s[0] + s[1] + s[2]) {
      printf("-1\n");
      return;
    }
    if (t[i] > s[1] + s[2])
      cnt[6]++;
    else if (t[i] > s[0] + s[2])
      cnt[5]++;
    else if (t[i] > s[0] + s[1] && t[i] > s[2])
      cnt[4]++;
    else if (t[i] > s[0] + s[1] || t[i] > s[2])
      cnt[3]++;
    else if (t[i] > s[1])
      cnt[2]++;
    else if (t[i] > s[0])
      cnt[1]++;
    else
      cnt[0]++;
  }
  int res = 0;
  res += cnt[6];
  cnt[6] = 0;
  res += cnt[5];
  cnt[0] -= cnt[5];
  cnt[5] = 0;
  if (cnt[0] < 0) cnt[0] = 0;
  res += cnt[4];
  cnt[1] -= cnt[4];
  cnt[4] = 0;
  if (cnt[1] < 0) {
    cnt[0] += cnt[1];
    cnt[1] = 0;
    if (cnt[0] < 0) cnt[0] = 0;
  }
  if (s[2] <= s[0] + s[1]) {
    res += cnt[3];
    cnt[2] -= cnt[3];
    cnt[3] = 0;
    if (cnt[2] < 0) {
      cnt[1] += cnt[2];
      cnt[2] = 0;
      if (cnt[1] < 0) {
        cnt[0] += cnt[1];
        cnt[1] = 0;
        if (cnt[0] < 0) cnt[0] = 0;
      }
    }
    res += f(cnt[0], cnt[1], cnt[2]);
  } else {
    res += g(cnt[0], cnt[1], cnt[2], cnt[3]);
  }
  printf("%d\n", res);
}
bool read_testcase() {
  if (scanf("%d\n", &n) != 1) return false;
  for (int i = 0; i < 3; i++) scanf("%d", s + i);
  for (int i = 0; i < n; i++) scanf("%d", t + i);
  return true;
}
int main(int argc, char **argv) {
  if (argc > 1 && argv[1][0] != 'x') freopen(argv[1], "r", stdin);
  if (argc > 2) freopen(argv[2], "w", stdout);
  int T = 1;
  clock_t cur, prev = clock();
  while (read_testcase()) {
    fprintf(stderr, ">>>Solving testcase %d<<<<\n", T);
    solve_testcase();
    cur = clock();
    int dur = (cur - prev) * 1000 / CLOCKS_PER_SEC;
    fprintf(stderr, "____Case %d done in %dms.\n", T, dur);
    prev = cur;
    T++;
  }
}
