import sys input=lambda: sys.stdin.readline().rstrip() l=int(input()) m=int(input()) n=int(input()) tot=(100*l+25*m+n)//1000 ans=0 ans+=tot//100 tot%=100 ans+=tot//25 tot%=25 ans+=tot print(ans)