(def N (read-line))
(def j (read-line))
(def i (map #(Integer/parseInt %) (clojure.string/split j #" ")))
(def t (map #(if (< (first %) (second %)) 0 1) (partition 2 1 i)))
(def p (apply + t))
(println (inc p))