C100 = int(input()) C25 = int(input()) C1 = int(input()) N1000 = 0 while 1: if C1 >=25: C25 += 1 C1 -= 25 elif C25>=4: C100 += 1 C25 -= 4 elif C100>=10: N1000 += 1 C100 -= 10 elif C100<10 and C25<4 and C1<25: break print(C1+C25+C100)