L=int(input()) M=int(input()) N=int(input()) X=(L*100+M*25+N)%1000 A=X//100 B=X%100 C=B//25 D=B%25 print(A+C+D)