import Data.Fixed
import Data.Char (digitToInt)
import System.IO
import System.IO.Error


data E100 = E100
instance HasResolution E100 where
      resolution _ =
                10^100
type Tc = Fixed E100

main :: IO ()
main = catchIOError loop (\e -> if isEOFError e
                           then return ()
                           else ioError e)

loop :: IO ()
loop = do
  st <- getLine
  let [a,b,n] = map read (words st)
      s'' = a/b
      s'  = dropWhile (/= '.') (show s'')
      s   = take (tcToInt n) $ map digitToInt (tail s')
  print $ sum s
  loop

tcToInt :: Tc -> Int
tcToInt n = (read ::String -> Int ) $ takeWhile (/='.') (show n)