l = int(input())
m = int(input())
n = int(input())

ans = 0

ans += n % 25
m += n // 25

ans += m % 4
l += m // 4

ans += l % 10
print(ans)