output_description: Print the number of ID cards that allow us to pass all the gates alone.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N M
      L_1 R_1
      L_2 R_2
      \vdots
      L_M R_M
attempt: x = lambda: map(int, input().split())
  N, M = x()
  l, r = zip(*[tuple(x()) for _ in range(M)])
  print(max(0, 1 + min(r) - max(l)))
  
problem_description: Statement
  
  We have N ID cards, and there are M gates.
  
  We can pass the i-th gate if we have one of the following ID cards: the L_i-
  th, (L_i+1)-th, ..., and R_i-th ID cards.
  
  How many of the ID cards allow us to pass all the gates alone?
samples: [{"input": "4 2\n    1 3\n    2 4", "output": "2\n    \n\nTwo ID cards allow us to pass all the gates alone, as follows:\n\n  * The first ID card does not allow us to pass the second gate.\n  * The second ID card allows us to pass all the gates.\n  * The third ID card allows us to pass all the gates.\n  * The fourth ID card does not allow us to pass the first gate.\n\n* * *"}, {"input": "10 3\n    3 6\n    5 7\n    6 9", "output": "1\n    \n\n* * *"}, {"input": "100000 1\n    1 100000", "output": "100000"}]