a = int(input()) b = int(input()) c = int(input()) ans = 0 b += c // 25 c %= 25 a += b // 4 b %= 4 a %= 10 print(a+b+c)