

map(function, iterable)
function : 적용할 함수
iterable : 함수를 적용할 데이터 집합
map(int,input().split())
-> int()함수적용해서 사용자로부터 입력받기

#백준 #20254 (Site Score)
# U_R, T_R, U_O, T_O 입력
U_R, T_R, U_O, T_O = map(int,input().split())
# Score 출력
# Score = 56UR + 24TR + 14UO + 6TO
Score = 56 * U_R + 24 * T_R + 14 * U_O + 6 * T_O
print(Score)