loop do
	a = gets.split.map &:to_i
	break if a.inject(:+) == 0
	bo = a[0] * 5 + a[1] * 3
	lost = 3 * (a[5] - a[4]) - bo
	gain = a[0] * 15 + a[1] * 15 + bo * 15 + a[2] * 7 + a[3] * 2
	puts 100 + gain - lost
end

