import Data.List
 
main :: IO ()
main = do
  [n,k] <- map (read :: String -> Int) . words <$> getLine
  an <- mySort . map (read :: String -> Int) . words <$> getLine
  print $ n - ans k an
 
ans :: Int -> [Int] -> Int
ans k an = snd $ foldr (\l (a,b) -> if a == k then (a,b) else (a+1,b+l)) (0,0) an
 
mySort :: [Int] -> [Int]
mySort xs = sort . map snd $ foldl func [] xs where
  func [] k = [(k,1)]
  func ((a,b):acc) k = if a == k then (a,b+1):acc else (a,b):func acc k