while line = gets
ans =[]
line = line.chomp.to_i
break if line == 0
a = line/200
b = line/300
c = line/500
  for i in 0..a
    for j in 0..b
      for k in 0..c
        if 200 * i + 300 * j + 500 * k == line
          ans.push([i,j,k])
        end
      end
    end
  end
  price = Float::INFINITY
  p = [[1520,1870,2244],[380,550,850]]
  for i in 0..(ans.length-1)
    tp = 0
    for j in 0..2
    t = ans[i][j] / (5-j)
      tp += t * p[0][j] + (ans[i][j] - t * (5 - j)) * p[1][j]
    end
       if tp < price
      price = tp
       end
  end
  puts price
end
