import Control.Monad
import Control.Applicative
import Data.List

main = do
  xs <- input (map read . words) :: IO [[Int]]
  mapM_ print $ map solve xs

solve :: [Int] -> Int
solve [x, y, z] = sum $ map (f d) [1..z]
  where
    f :: Double -> Int -> Int
    f e i = truncate (e * (10 ^ i)) `mod` 10
    d = (fromIntegral x) / (fromIntegral y)

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