hand=input() hand_split=hand.split() a=int(hand_split[0]) b=int(hand_split[1]) c=int(hand_split[2]) 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)