object Main extends App {
    for (r <- io.Source.stdin.getLines.map(_.split(" ").map(_.toInt))) {
        var (rem, res, i) = (r(0), 0, r(2))
        while (i > 0) {
            rem = rem % r(1) * 10
            res += rem / r(1)
            i -= 1
        }
        println(res)
    }
}