import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS

main :: IO ()
main = do
    [n, k] <- getIntList
    putStrLn . show $ length . takeWhile (>= 1) $ map (\x -> (fromIntegral n) / (fromIntegral k^x)) [0..]


readInt = fst . fromJust . BS.readInteger
readIntList = map readInt . BS.words
getIntList = readIntList <$> BS.getLine
getIntNList n = map readIntList <$> replicateM (fromIntegral n) BS.getLine