H=int(input())
Q=int(input())
O=int(input())
A=O//25
Q=Q+A
O=O-A*25
B=Q//4
H=H+B
Q=Q-B*4
C=H//10
H=H-C*10
print(O+Q+H)