import Control.Monad main = do [n,m] <- replicateM 2 readLn putStrLn . show $ 1000 * (div (div n m) 1000)