#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200005;
const int mod = 1e9 + 7;
struct Node {
  int x, y, z;
  Node() {}
  Node(int _x, int _y, int _z) {
    x = _x;
    y = _y;
    z = _z;
    if (x < y) swap(x, y);
    if (x < z) swap(x, z);
    if (y < z) swap(y, z);
  }
  bool operator<(const Node& a) const {
    if (x != a.x) return x < a.x;
    if (y != a.y) return y < a.y;
    return z < a.z;
  }
};
Node a[10];
int A, B, C;
set<pair<int, int> > s;
set<pair<int, int> >::iterator it;
int v[MAXN];
int vis[MAXN];
int n;
void solve() {
  s.clear();
  memset(vis, 0, sizeof vis);
  scanf("%d%d%d", &A, &B, &C);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &v[i]);
  }
  sort(v + 1, v + n + 1);
  for (int i = 1; i <= n; ++i) {
    s.insert(make_pair(v[i], i));
  }
  a[0] = Node(A, B, C);
  a[1] = Node(A + B, C, 0);
  a[2] = Node(A + C, B, 0);
  a[3] = Node(B + C, A, 0);
  a[4] = Node(A + B + C, 0, 0);
  sort(a, a + 5);
  int ans = 0;
  for (int i = n; i >= 1; --i)
    if (!vis[i]) {
      int ok = 0;
      ++ans;
      for (int j = 0; j < 5; ++j) {
        if (a[j].x >= v[i]) {
          ok = 1;
          vis[i] = 1;
          s.erase(make_pair(v[i], i));
          int t = 0;
          if (s.begin() == s.end()) break;
          it = s.lower_bound(make_pair(a[j].y, 0x3f3f3f3f));
          if (it != s.begin()) {
            --it;
            vis[it->second] = 1;
            s.erase(*it);
            ++t;
          }
          if (s.begin() == s.end()) break;
          it = s.lower_bound(make_pair(a[j].z, 0x3f3f3f3f));
          if (it != s.begin()) {
            --it;
            vis[it->second] = 1;
            s.erase(*it);
            ++t;
          }
          if (t == 0) {
            it = s.lower_bound(make_pair(a[j].y + a[j].z, 0x3f3f3f3f));
            if (it != s.begin()) {
              --it;
              vis[it->second] = 1;
              s.erase(*it);
              ++t;
            }
          }
          break;
        }
      }
      if (!ok) {
        printf("-1\n");
        return;
      }
    }
  printf("%d\n", ans);
}
int main() {
  while (~scanf("%d", &n)) solve();
  return 0;
}
