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