{"raw_statement":[{"iden":"problem statement","content":"You are given sequences of length $N$ each: $A = (A_1, A_2, A_3, \\dots, A_N)$ and $B = (B_1, B_2, B_3, \\dots, B_N)$.  \nFind the number of integers $x$ satisfying the following condition:\n\n*   $A_i \\le x \\le B_i$ holds for every integer $i$ such that $1 \\le i \\le N$."},{"iden":"constraints","content":"*   $1 \\le N \\le 100$\n*   $1 \\le A_i \\le B_i \\le 1000$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $A_3$ $\\dots$ $A_N$\n$B_1$ $B_2$ $B_3$ $\\dots$ $B_N$"},{"iden":"sample input 1","content":"2\n3 2\n7 5"},{"iden":"sample output 1","content":"3\n\n$x$ must satisfy both $3 \\le x \\le 7$ and $2 \\le x \\le 5$.  \nThere are three such integers: $3$, $4$, and $5$."},{"iden":"sample input 2","content":"3\n1 5 3\n10 7 3"},{"iden":"sample output 2","content":"0\n\nThere may be no integer $x$ satisfying the condition."},{"iden":"sample input 3","content":"3\n3 2 5\n6 9 8"},{"iden":"sample output 3","content":"2"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}