#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
int pe[3];
int ar[N];
int n;
int ans;
int st[1 << 3];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < 3; i++) scanf("%d", &pe[i]);
  for (int i = 0; i < n; i++) scanf("%d", &ar[i]);
  sort(pe, pe + 3);
  sort(ar, ar + n);
  int now = n - 1;
  if (ar[now] > pe[0] + pe[1] + pe[2]) {
    puts("-1");
    return 0;
  }
  while (now >= 0 && ar[now] > pe[1] + pe[2]) {
    now--;
    ans++;
  }
  int x, y, tmp;
  x = y = tmp = 0;
  while (now >= 0 && ar[now] > pe[0] + pe[2]) {
    now--;
    ans++;
    st[0]--;
  }
  while (now >= 0 && ar[now] > max(pe[2], pe[0] + pe[1])) {
    now--;
    ans++;
    st[1]--;
  }
  while (now >= 0 && ar[now] > pe[1]) {
    if (ar[now] <= pe[2]) x++;
    if (ar[now] <= pe[0] + pe[1]) y++;
    now--;
  }
  if (pe[0] + pe[1] > pe[2]) {
    y -= x;
    if (y >= x) {
      ans += y;
      now -= y - x;
    }
  }
  st[1] += st[0];
  st[2] += st[1];
  for (int i = 0; i <= now; i++)
    for (int j = 0; j < 3; j++) {
      if (ar[i] <= pe[j]) st[j]++;
    }
  st[2] -= st[1];
  st[1] -= st[0];
  if (st[1] < 0) {
    st[0] += st[1];
    st[1] = 0;
  }
  if (pe[0] + pe[1] <= pe[2]) {
    x -= y;
    while (x > 0 || y > 0) {
      ans++;
      if (x > 0)
        x--;
      else
        y--;
      if (st[1] > 0) {
        st[1]--;
        st[0]--;
      } else if (st[0] > 0)
        st[0] -= 2;
      else
        y--;
    }
  } else if (y < x) {
    ans += y;
    x -= y;
    while (x > 0) {
      ans++;
      x--;
      if (st[1] > 0) {
        st[1]--;
        st[0]--;
      } else if (st[0] > 0)
        st[0] -= 2;
      else
        x--;
    }
  }
  st[0] = max(0, st[0]);
  if ((st[1] + 1) / 2 >= st[0])
    ans += (st[1] + 1) / 2;
  else
    ans += (st[0] + st[1] + 2) / 3;
  printf("%d\n", ans);
  return 0;
}
