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