a = int(input()) b = int(input()) c = int(input()) while c >= 25: c -= 25 b += 1 while b >= 4: b -= 4 a += 1 while a >= 10: a -= 10 print(a+b+c)