Shiwom is playing Elder Ning (the pirated version of PC game Elden Ring). He came across a level in the game where he has to choose a single sword from $$$n$$$ different swords and he has to fight against $$$m$$$ mighty monsters using that sword!!! To kill the $$$i$$$-th monster he can use any of the following swords - $$$L_{i}$$$-th, $$$L_{i}+1$$$-th, ...., $$$R_{i}-1$$$-th, $$$R_{i}$$$-th.
Out of the $$$n$$$ swords, Shiwom would only choose that one for his battle which is capable of killing all of the monsters. So your task is to find the number of swords which are capable of killing all the monsters.
The first line of input contains integers $$$n$$$ and $$$m$$$ $$$(1 \leq n,m \leq 10^{5})$$$ – the number of swords and number of monsters respectively.
Each of the next $$$m$$$ lines of input contain integers $$$L_{i}$$$ and $$$R_{i}$$$ $$$(1 \leq L_{i} \leq R_{i} \leq n)$$$ – the left and right limit of the range of swords which can kill the $$$i$$$-th monster.
Print the number of swords which are capable of killing all the monsters.
4 2 1 2 1 4
2
10 3 1 7 5 10 3 4
0
For the first sample testcase —
For the second testcase —