let sum a b n =
  let rec iter c s m =
    if m = 0 then s
    else iter ((10 * c) mod b) ((10 * c) / b + s) (m - 1) in
  iter (a mod b) 0 n
  
let _ =
  try
    while true do
      let s = Scanf.scanf "%d %d %d\n" sum in
      Printf.printf "%d\n" s
    done
  with
    End_of_file -> ()