#include <bits/stdc++.h>
using namespace std;
multiset<int> st;
int solve(int a, int b, int c) {
  int ans = 0;
  while (true) {
    multiset<int>::iterator it = st.upper_bound(c);
    if (it == st.end()) break;
    ans++;
    st.erase(it);
  }
  for (int i = 0; i < ans; i++) {
    multiset<int>::iterator it = st.upper_bound(a);
    if (it != st.begin()) {
      --it;
      st.erase(it);
    } else
      break;
  }
  return ans;
}
int cal(int arr[], int n, int a, int b, int c) {
  int lt = 1, rt = n, mid, ans = n;
  sort(arr + 1, arr + n + 1);
  while (lt <= rt) {
    mid = (lt + rt) >> 1;
    int tmp = n - mid;
    int x = 0, y = 0, z = 0;
    for (int i = 1; i <= tmp; i++) {
      if (arr[i] <= a)
        x++;
      else if (arr[i] <= b)
        y++;
      else if (arr[i] <= a + b)
        z++;
      else {
        x = y = z = n;
        break;
      }
    }
    if (z + y > mid)
      lt = mid + 1;
    else {
      int need = z;
      if (x <= y)
        need += y;
      else {
        need += y + (x - y + 1) / 2;
      }
      if (need <= mid)
        rt = mid - 1, ans = mid;
      else
        lt = mid + 1;
    }
  }
  return ans;
}
int main() {
  int n;
  int a, b, c;
  scanf("%d", &n);
  scanf("%d%d%d", &a, &b, &c);
  if (a > b) swap(a, b);
  if (a > c) swap(a, c);
  if (b > c) swap(b, c);
  int ans = 0, x;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    if (x > a + b + c) {
      printf("-1\n");
      return 0;
    }
    if (x > b + c)
      ans++;
    else
      st.insert(x);
  }
  ans += solve(a, b + c, a + c);
  ans += solve(b, a + c, max(a + b, c));
  if (a + b > c) {
    ans += solve(c, a + b, c);
  }
  int arr[200010];
  int cnt = 0;
  for (multiset<int>::iterator it = st.begin(); it != st.end(); ++it) {
    arr[++cnt] = *it;
  }
  ans += cal(arr, cnt, a, b, c);
  printf("%d\n", ans);
  return 0;
}
