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