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