{"raw_statement":[{"iden":"problem statement","content":"We have $N$ ID cards, and there are $M$ gates.\nWe 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.\nHow many of the ID cards allow us to pass all the gates alone?"},{"iden":"constraints","content":"*   All values in input are integers.\n*   $1 \\leq N \\leq 10^5$\n*   $1 \\leq M \\leq 10^5$\n*   $1 \\leq L_i \\leq R_i \\leq N$"},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $M$\n$L_1$ $R_1$\n$L_2$ $R_2$\n$\\vdots$\n$L_M$ $R_M$"},{"iden":"sample input 1","content":"4 2\n1 3\n2 4"},{"iden":"sample output 1","content":"2\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."},{"iden":"sample input 2","content":"10 3\n3 6\n5 7\n6 9"},{"iden":"sample output 2","content":"1"},{"iden":"sample input 3","content":"100000 1\n1 100000"},{"iden":"sample output 3","content":"100000"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}