N = int(input()) M = int(input()) L = int(input()) addM = L // 25 adjL = L % 25 addN = (addM + M) // 4 adjM = (addM + M) % 4 addO = (addN + N) // 10 adjN = (addN + N) % 10 print(adjL + adjM + adjN)