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