#abc202c. [abc202_c]Made Up
[abc202_c]Made Up
Problem Statement
Given are three sequences of length each: , , and , consisting of integers between and (inclusive).
How many pairs of integers between and (inclusive) satisfy ?
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the number of pairs such that .
Sample Input 1
3
1 2 2
3 1 2
2 3 2
Sample Output 1
4
Four pairs satisfy the condition: .
Sample Input 2
4
1 1 1 1
1 1 1 1
1 2 3 4
Sample Output 2
16
All the pairs satisfy the condition.
Sample Input 3
3
2 3 3
1 3 3
1 1 1
Sample Output 3
0
No pair satisfies the condition.