import Control.Monad
import Data.List

getInt = read <$> getLine :: IO Int
getInts = map read . words <$> getLine :: IO [Int]


calc l = calc_ 1234567890 0 0 l
calc_ min w ct [] = ct
calc_ min w ct (a:as) | a<min     = calc_ a w ct as
                      | (a-min)>w = calc_ min (a-min) 1 as
                      | (a-min)<w = calc_ min w ct as
                      | otherwise = calc_ min w (ct+1) as

main = do
    [n, t] <- getInts
    as <- getInts
    print $ calc as

