import qualified Data.ByteString.Char8 as C
import Data.List
import Data.Ord

main = sol <$> get <*> get >>= print

get = unfoldr (C.readInt . C.dropWhile (==' ')) <$> C.getLine

sol [n,k] = (\x -> if x>0 then x-1 else n) . 
  length . dropWhile (k>) . scanl1 (+) . sortBy (flip compare)