l = int(input()) m = int(input()) n = int(input()) total = (l * 100) + (m * 25) + n over = total % 1000 (l, over) = divmod(over, 100) (m, n) = divmod(over, 25) print(l + m + n)