#abc199b. [abc199_b]Intersection
[abc199_b]Intersection
Problem Statement
You are given sequences of length each: and .
Find the number of integers satisfying the following condition:
- holds for every integer such that .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
2
3 2
7 5
Sample Output 1
3
must satisfy both and .
There are three such integers: , , and .
Sample Input 2
3
1 5 3
10 7 3
Sample Output 2
0
There may be no integer satisfying the condition.
Sample Input 3
3
3 2 5
6 9 8
Sample Output 3
2