import Control.Applicative ((<$>), (<*>))
import Control.Monad
import Data.List

main :: IO ()
main = do
  ns <- inpi $ split toInt
  mapM_ print $ solve ns

solve :: [[Int]] -> [Int]
solve = map sumOfNthDecimalPlaces

sumOfNthDecimalPlaces :: [Int] -> Int
sumOfNthDecimalPlaces [a, b, n] = so1dp 0 n (a `mod` b)
  where so1dp acc c x | c == 0 = acc
                      | otherwise = so1dp (acc + (10 * x) `div` b) (c - 1) ((10 * x) `mod` b)

toInt :: String -> Int
toInt s = read s

split :: (String -> a) -> String -> [a]
split f = map f . words

inpi :: (String -> a) -> IO [a]
inpi f = map f . lines <$> getContents