L = int(input()) M = int(input()) N = int(input()) total = L * 100 + M * 25 + N * 1 k = total // 1000 total -= k * 1000 l = total // 100 total -= l * 100 m = total // 25 total -= m * 25 n = total print(l + m + n)