fun main(args: Array<String>) {
    fun printlnInt(x: Number) = println(x.toInt())

    val (a, b, x) = readLine()!!.split(" ").map { it.toInt() }
    val litter = x / 1000.toDouble()
    val milliLitter = x / 500.toDouble()
    val allA = (Math.ceil(litter) * a).toInt()
    val allB = (Math.ceil(milliLitter) * b).toInt()
    val aAndB = ((x / 1000) * a + Math.ceil((x % 1000) / 500.toDouble()) * b).toInt()
    println(listOf(allA, allB, aAndB).min()!!)
}
