import Data.List

main = do
  getLine
  ps <- map read . words <$> getLine
  print (der ps)

der = count . map fst . filter (uncurry (==)) . zip [1..] 

count [] = 0
count [n] = 1
count (n1:n2:ns)
  | n1 + 1 == n2 = 1 + count ns
  | otherwise = 1 + count (n2:ns)