main = do
    amount <- readLn
    if amount == 0 then return ()
                   else do
                       print $ searchMinimumPriceOf amount
                       main

searchMinimumPriceOf :: Int -> Int
searchMinimumPriceOf = minimum.map totalPrice.searchComb

searchComb :: Int -> [(Int,Int,Int)]
searchComb p = [(x,y,z) | x <- [0..25], y <- [0..17], z <- [0..10], 200*x+300*y+500*z == p]

totalPrice :: (Int,Int,Int) -> Int
totalPrice (x,y,z) = shopAprice x + shopBprice y + shopCprice z

shopAprice :: Int -> Int
shopAprice = shopPrice 'a'
shopBprice = shopPrice 'b'
shopCprice = shopPrice 'c'

shopPrice :: Char -> Int -> Int
shopPrice  s = priceCalc pa pp du dr
    where [pa,pp,du,dr] = case s of
                            'a' -> [200,380,5,20]
                            'b' -> [300,550,4,15]
                            'c' -> [500,850,3,12]

priceCalc packAmount packPrice discountUnit disCountRate amount =
    if amount `mod` discountUnit == 0 then amount `div` discountUnit * discountUnit * packPrice * (100 - disCountRate) `div` 100
                                      else amount `div` discountUnit * discountUnit * packPrice * (100 - disCountRate) `div` 100 + amount `mod` discountUnit * packPrice