import std.algorithm;
import std.range;
import std.stdio;
import std.math;
import std.array;
import std.string;
import std.conv;

/// 数列の読み込み
auto readNums(T = int)() {
	return readln().chomp.split.map!(to!T).array;
}

auto minElement(R)(R r) {
    return r.reduce!((a, b) => min(a, b));
}


void main() {
	auto nums = readNums();
	immutable n = nums[0];
	immutable a = nums[1];
	immutable b = nums[2];
	immutable c = nums[3];
	auto bars = iota(0, n).map!((i) => readNums()[0]).array;
	
	void calculateMp(int l, int beforeMp, ulong used, scope void delegate(int, ulong) f) {
		foreach(mask; 1 .. (1UL << n)) {
			if(mask & used) {
				continue;
			}
			int createdLen = 0;
			int count = 0;
			foreach(i; 0 .. n) {
				if(mask & (1UL << i)) {
					createdLen += bars[i];
					++count;
				}
			}
			immutable mp = beforeMp + abs(createdLen - l) + 10 * (count - 1);
			f(mp, used | mask);
		}
	}
	
	int minMp = int.max;
	calculateMp(a, 0, 0, delegate(mp1, used1) {
		calculateMp(b, mp1, used1, delegate(mp2, used2) {
			calculateMp(c, mp2, used2, delegate(mp3, used3) {
				minMp = min(minMp, mp3);
			});
		});
	});
	writefln("%s", minMp);
}