object Main extends App {
    for (Array(a, b, n) <- io.Source.stdin.getLines.map(_.split(" ").map(_.toInt))) {
        val x = (0 until n).foldLeft((a, 0))((p, _) => (p._1 % b * 10, p._2 + p._1 % b * 10 / b))
        println(x._2)
    }
}