#abc262c. [abc262_c]Min Max Pair
[abc262_c]Min Max Pair
Problem Statement
You are given a sequence of length consisting of integers between and .
Find the number of pairs of integers that satisfy all of the following conditions:
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
4
1 3 2 4
Sample Output 1
2
satisfy the conditions.
Sample Input 2
10
5 8 2 2 1 6 7 2 9 10
Sample Output 2
8