m100=int(input()) m25=int(input()) m1=int(input()) if m1>=25: kuriage1=int(m1/25) m25+=kiriage1 m1=int(m1%25) if m25>=4: kuriage25=int(m25/4) m100+=kuriage25 m25=int(m25%4) if m100>=10: m1000=0 kuriage100=int(m100/10) m1000+=kuriage100 m100=int(m100%10) print(m1+m25+m100)