a=int(input()) b=int(input()) c=int(input()) sum=a*100+b*25+c sum%=1000 count=0 count+=sum//100 sum%=100 count+=sum//25 sum%=25 count+=sum print(count)