L = int(input()) M = int(input()) N = int(input()) yen1 = L % 25 yen25 = (L // 25 + M) % 4 yen100 = (M // 4 + N) % 10 C = yen1 + yen25 + yen100 print(C)