L = int(input()) M = int(input()) N = int(input()) carry1, c = divmod(N, 25) carry2, b = divmod(M + carry1, 4) a = (L + carry2) % 10 print(a + b + c)