#include <bits/stdc++.h>
using namespace std;
const int maxn = 10;
const int maxtot = 300;
int n, m, targets[3], l[maxn], cost[maxtot][3], f[3][maxtot];
int min4(int a, int b, int c, int d) {
  if (a > b) a = b;
  if (a > c) a = c;
  if (a > d) a = d;
  return a;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 0; i < 3; ++i) cin >> targets[i];
  for (int i = 0; i < n; ++i) cin >> l[i];
  int tot = 1 << n;
  for (int i = 1; i < tot; ++i) {
    int cnt = 0, len = 0;
    for (int j = 0; j < n; ++j)
      if (i & (1 << j)) {
        ++cnt;
        len += l[j];
      }
    cnt = (cnt - 1) * 10;
  }
  int ans = INT_MAX;
  for (int i = 0; i < 3; ++i)
    for (int j = 1; j < tot; ++j) {
      if (i == 0)
        f[i][j] = cost[j][i];
      else {
        f[i][j] = INT_MAX / 2;
        for (int k = 1; k < j; ++k) {
          if (f[i - 1][j - k] == INT_MAX / 2) continue;
          f[i][j] = min(f[i][j], f[i - 1][j - k] + cost[k][i]);
        }
        if (i == 2) ans = min(ans, f[i][j]);
      }
    }
  cout << ans << endl;
  return 0;
}
