L = int(input()) M = int(input()) N = int(input()) s = 0 q, mod = divmod(N, 25) M += q s += mod q, mod = divmod(M, 4) L += q s += mod mod = L % 10 s += mod print(s)