a=int(input()) b=int(input()) c=int(input()) if c>=25: b+=c//25 c=c%25 if b>=4: a+=b//4 b=b%4 if a>=10: a=a%10 sum=a+b+c print(sum)