# 標準入力から一行分を読み出し、文字列として格納する。 L = int(input()) M = int(input()) N = int(input()) total = L * 100 + M * 25 + N thousand_count = total // 1000 total -= thousand_count * 1000 hundred_count = total // 100 total -= hundred_count * 100 quater_count = total // 25 total -= quater_count * 25 one_count = total print(hundred_count+quater_count+one_count)