l = int(input()) m = int(input()) n = int(input()) lc = (l + ((m + n // 25) // 4)) % 10 mc = (m + n // 25) % 4 nc = n % 25 coins = lc + mc + nc print(coins)