l100=int(input()) m25=int(input()) n1=int(input()) o1000=0 while n1 >= 25: n1-=25 m25+=1 #print(o1000,l100,m25,n1,'step1') while m25 >= 4: m25-=4 l100+=1 #print(o1000,l100,m25,n1,'step2') while l100 >= 10: l100-=10 o1000+=1 #print(o1000,l100,m25,n1,'step3') print(o1000+l100+m25+n1) #print(o1000,l100,m25,n1)