#include <bits/stdc++.h>
using namespace std;
using ull = unsigned long long;
int N, A, B, C;
int L[8];
int dfs(int cur, int a, int b, int c) {
  int ret1, ret2, ret3, ret4;
  if (cur == N) {
    if (min({a, b, c}) > 0) {
      return abs(a - A) + abs(b - B) + abs(c - C) - 30;
    } else
      return 1e+9;
  } else {
    ret1 = dfs(cur + 1, a, b, c);
    ret2 = dfs(cur + 1, a + L[cur], b, c) + 10;
    ret3 = dfs(cur + 1, a, b + L[cur], c) + 10;
    ret4 = dfs(cur + 1, a, b, c + L[cur]) + 10;
    return min({ret1, ret2, ret3, ret4});
  }
}
int main() {
  int li, ans;
  cin >> N >> A >> B >> C;
  for (int i = 0; i < N; i++) cin >> li, L[i] = li;
  ans = dfs(0, 0, 0, 0);
  cout << ans << endl;
  cout << ans << endl;
  return 0;
}
