Archaeologists have found a strange device that was probably created by some ancient civilization. The device has a screen that displays two integers:
After exploring the device the scientists have made a conclusion that the device is kind of a clock. It measures time
The archaeologists have studied the device and found out that its screen wasn't turned on all the time. Actually it was only working during
Two pairs
Input Specification
The first line contains three integers
Each of the following
Output Specification
Output the number of distinct pairs
Scoring
Let
Subtask 1 (points: 10)
Subtask 2 (points: 5)
Subtask 3 (points: 5)
Subtask 4 (points: 5)
Subtask 5 (points: 5)
Subtask 6 (points: 20)
Subtask 7 (points: 20)
Subtask 8 (points: 30)
No additional constraint.
Sample Input 1
3 3 3
4 4
7 9
17 18
Sample Output 1
4
Sample Input 2
3 5 10
1 20
50 68
89 98
Sample Output 2
31
Sample Input 3
2 16 13
2 5
18 18
Sample Output 3
5
Explanation
In the first test, the device screen shows the following integers.
So there are four distinct pairs
Comments
It's actually even smaller:
fits inside a 
)
long long
. (