a, b, x = gets.split.map(&:to_i)
if a >= 2 * b
    puts (x / 500.0).ceil * b
else
    ka = (x / 1000.0).floor
    y = x - 1000 * ka
    if y == 0
        puts ka * a
    else
        puts ka * a + [a, (y / 500.0).ceil * b].min
    end
end
