x = int(input()) y = int(input()) z = int(input()) amari = z % 25 amari += (y + z // 25) % 4 amari += (x + (y + z // 25) // 4) % 10 print(amari)