def sumdigit(n)
  if n < 10
    return n
  else
    return sumdigit(n / 10) + n % 10
  end
end
while (arg = gets)
  arg = arg.split(" ").map(&:to_i)
  puts sumdigit((arg[0] % arg[1] * 10 ** arg[2]) / arg[1])
end