import numpy as np
import itertools
def choose_least_diff(rest_nums, used, target, cur_step):
    #targetを実現するのに最小のパターンを探す
    if cur_step == len(rest_nums) or np.abs(target) <= 10:
        #探索終了
        if np.sum(used.astype(np.int)) == 0:
            #全部offのパターンを返してしまうのを避ける
            return np.sum(rest_nums),used
        else:
            final_cost = (np.sum(used.astype(int)) - 1) * 10 + np.abs(target)
            return final_cost,used
    
    #Offパターンを試す
    cur_used = used.copy()
    ret_off,used_off = choose_least_diff(rest_nums, cur_used, target,cur_step + 1)
        
    #Onパターンを試す
    cur_used[cur_step] = True
    ret_on,used_on = choose_least_diff(rest_nums, cur_used, target - rest_nums[cur_step],cur_step + 1)
    
    #cur_stepがOff,Onのそれぞれの場合で最も良い結果が得られるパターンを比較して良い方を返す
    if ret_on > ret_off:
        return ret_off, used_off
    else:
        return ret_on, used_on
    
def q3():
    N,A,B,C = list(map(int,input().split()))
    l = []
    for n in range(N):
        l.append(int(input()))
    l = np.array(l)
    
    min_ret = np.sum(l)
    used = np.zeros_like(l,dtype=np.bool)
    orders = list(itertools.permutations([A,B,C]))
    for (first,second,third) in orders:
        ret1,used1 = choose_least_diff(l,used,first,0)
        l2 = l[~used1]
        used1 = np.zeros_like(l2,dtype=np.bool)
        
        ret2, used2 =  choose_least_diff(l2,used1,second,0)
        l3 = l2[~used2]
        used2 = np.zeros_like(l3,dtype=np.bool)
        
        ret3, _ =  choose_least_diff(l3,used2,third,0)
        min_ret = min(min_ret,ret1 + ret2 + ret3)

    print(min_ret)
    
q3()