There are $\textstyle n$ people standing in a line, numbered from $\textstyle 1$ to $\textstyle n$ from left to right. Among these people, there are $\textstyle m$ pairs of friends.
Define an interval $\textstyle [l,r]$ ($\textstyle 1 \leq l \leq r \leq n$) as friendly if and only if every pair of people within the interval are friends.
How many friendly intervals are there?
输入格式
The first line contains two integers $\textstyle n$ and $\textstyle m$ ($\textstyle 1 \leq n, m \leq 10^6$), representing the number of people and the number of pairs of friends, respectively.
The next $\textstyle m$ lines each contain two integers $\textstyle u$ and $\textstyle v$ ($\textstyle 1 \leq u < v \leq n$), representing a pair of friends.
It is guaranteed that there are no duplicate friend pairs in the input.
输出格式
Output a single integer representing the number of friendly intervals.