import Text.Printf

sum_decimal :: Int->Int->Int->Int->Int
sum_decimal a b n i 
    | i==n      = d
    | otherwise = d + (sum_decimal a' b n (i+1))
        where a' = (a*10)`mod`b
              d = (a*10)`div`b

solve :: String->IO ()
solve str = do
    let dat = map (\x->read x::Int) $ words str
    let (a, b, n) = (dat!!0, dat!!1, dat!!2)
    printf "%d\n" (sum_decimal (a`mod`b) b n 1)

main :: IO ()
main = do
    str <- getContents
    mapM_ solve $ lines str