#include <bits/stdc++.h>
using namespace std;
using LL = int64_t;
using ULL = uint64_t;
using LD = long double;
using pii = pair<int, int>;
int N;
int s1, s2, s3, s12, s13, s23, s123;
LL c1, c2, c3, c12, c23, c13, c123;
int main() {
  {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
  };
  cin >> N;
  cin >> s1 >> s2 >> s3;
  if (s1 > s2) swap(s1, s2);
  if (s2 > s3) swap(s2, s3);
  if (s1 > s2) swap(s1, s2);
  s123 = s1 + s2 + s3;
  s12 = s1 + s2, s13 = s1 + s3, s23 = s2 + s3;
  LL ans = 0;
  if (s12 > s3) {
    bool fail = false;
    for (int i = 1; i <= N; i++) {
      int a;
      cin >> a;
      if (a <= s1)
        ++c1;
      else if (a <= s2)
        ++c2;
      else if (a <= s3)
        ++c3;
      else if (a <= s12)
        ++c12;
      else if (a <= s13)
        ++c13;
      else if (a <= s23)
        ++c23;
      else if (a <= s123)
        ++c123;
      else
        fail = true;
    }
    if (fail) {
      cout << "-1\n";
      return 0;
    }
    ans = c123;
    while (c23 > 0 || c13 > 0 || c12 > 0 || c3 > 0 || c2 > 0 || c1 > 0) {
      if (c23 > 0) {
        --c23;
        if (c1 > 0) --c1;
      } else if (c13 > 0) {
        --c13;
        if (c2 > 0)
          --c2;
        else if (c1 > 0)
          --c1;
      } else if (c12 > 0) {
        --c12;
        if (c3 > 0)
          --c3;
        else if (c2 > 0)
          --c2;
        else if (c1 > 0)
          --c1;
      } else if (c3 > 0) {
        --c3;
        if (c2 > 0) {
          --c2;
          if (c1 > 0) --c1;
        } else if (c1 > 0) {
          c1 -= 2;
        } else if (c3 > 0)
          --c3;
      } else if (c2 > 0) {
        --c2;
        if (c2 > 0)
          --c2;
        else if (c1 > 0)
          --c1;
        if (c1 > 0) --c1;
      } else if (c1 > 0) {
        c1 -= 3;
      }
      ++ans;
    }
  } else {
    bool fail = false;
    for (int i = 1; i <= N; i++) {
      int a;
      cin >> a;
      if (a <= s1)
        ++c1;
      else if (a <= s2)
        ++c2;
      else if (a <= s12)
        ++c12;
      else if (a <= s3)
        ++c3;
      else if (a <= s13)
        ++c13;
      else if (a <= s23)
        ++c23;
      else if (a <= s123)
        ++c123;
      else
        fail = true;
    }
    if (fail) {
      cout << "-1\n";
      return 0;
    }
    ans = c123;
    while (c23 > 0 || c13 > 0 || c12 > 0 || c3 > 0 || c2 > 0 || c1 > 0) {
      if (c23 > 0) {
        --c23;
        if (c1 > 0) --c1;
      } else if (c13 > 0) {
        --c13;
        if (c2 > 0)
          --c2;
        else if (c1 > 0)
          --c1;
      } else if (c3 > 0) {
        --c3;
        if (c2 > 0) {
          --c2;
          if (c1 > 0) --c1;
        } else if (c1 > 0) {
          c1 -= 2;
        } else if (c12 > 0)
          --c12;
      } else if (c12 > 0) {
        --c12;
        if (c2 > 0) {
          --c2;
          if (c1 > 0) --c1;
        } else if (c1 > 0) {
          c1 -= 2;
        } else if (c12 > 0)
          --c12;
      } else if (c2 > 0) {
        --c2;
        if (c2 > 0)
          --c2;
        else if (c1 > 0)
          --c1;
        if (c1 > 0) --c1;
      } else if (c1 > 0) {
        c1 -= 3;
      }
      ++ans;
    }
  }
  cout << ans << '\n';
  return 0;
}
inline int read_char() {
  constexpr int N = 1 << 20;
  static char buf[N];
  static char *p = buf, *end = buf;
  if (p == end) {
    if ((end = buf + fread(buf, 1, N, stdin)) == buf) return EOF;
    p = buf;
  }
  return *p++;
}
inline int read_int(int &x) {
  static char c, neg;
  while ((c = read_char()) < '-')
    if (c == EOF) return 0;
  neg = (c == '-') ? -1 : 1;
  x = (neg == 1) ? c - '0' : 0;
  while ((c = read_char()) >= '0') x = (x << 3) + (x << 1) + (c - '0');
  x *= neg;
  return 1;
}
char _buf[128];
inline void write_int(LL x) {
  if (!x) {
    putchar('0');
    putchar('\n');
    return;
  }
  int t = 0;
  while (x) {
    _buf[t++] = x % 10 + '0';
    x /= 10;
  }
  while (t--) putchar(_buf[t]);
  putchar('\n');
}
