k100=input() k25=input() k1=input() math=0 math+=k1%25 k25+=k1//25 math+=k25%4 k100+=k25//4 math+=k100%100 print(math)