#include <bits/stdc++.h>
using namespace std;
int N, a[10], b[10], x[3];
void take(int x) {
  for (int i = x; i < 8; i++)
    if (a[i] > 0) {
      a[i]--;
      return;
    }
}
int func(void) {
  int i;
  for (int i = 0; i < 8; i++) b[i] = a[i];
  int ans = b[1] + b[2];
  b[7] -= b[2];
  b[6] += max(b[7], 0);
  ans += b[3];
  b[6] -= b[3];
  b[5] += max(b[6], 0);
  ans += max(b[4], (b[4] + b[5] + 1) / 2);
  return ans;
}
int main() {
  cin >> N;
  for (int i = 0; i < 3; i++) cin >> x[i];
  sort(x, x + 3);
  for (int i = 0; i < N; i++) {
    int y, cnt = 0;
    scanf("%d", &y);
    for (int j = 0; j < 8; j++) {
      int tmp = 0;
      for (int k = 0; k < 3; k++)
        if (j & (1 << k)) tmp += x[k];
      if (tmp >= y) cnt++;
    }
    a[cnt]++;
  }
  if (a[0] > 0) {
    cout << -1 << endl;
    return 0;
  }
  int ans = N;
  for (int i = 0; i < N + 1; i++) {
    int tmp = func();
    ans = min(ans, tmp + i);
    take(7);
    take(6);
    take((x[0] + x[1] > x[2]) ? 5 : 4);
  }
  cout << ans << endl;
  return 0;
}
