(require '[clojure.string :as str])

(println
 (apply + (for [line (rest (line-seq (clojure.java.io/reader *in*)))]
            (let [[l r] (as-> line v
                          (str/split v #"\s")
                          (map #(Long/parseLong %) v))]
              (inc (- r l))))))
