Alice took a clean sheet of paper and drew
The horizontal lines have
Given these coordinates, count the number of squares that appeared on the paper.
(The whole boundary of the square has to be drawn. The inside of the square does not have to be empty.)
Input
The first line of input contains the integers
The second line of input contains a strictly increasing sequence consisting of
The third line of input contains a strictly increasing sequence consisting of
All horizontal and vertical coordinates are between
Output
Output a single line with a single integer: the total number of squares.
Scoring
Subtask
Subtask
Subtask
Sample Input
3 4
0 1 3
1 2 4 8
Sample Output
3
Note
In the example there is one
Comments