Triplets#5894

Triplets

1 second
64 megabytes
Very easy

Given three ranges of integers , , and , determine the total number of ordered triples of integers (x, y, z) that satisfy the following conditions:

Input

The first line of the input contains the integer . The second line contains integers separated by spaces, representing the sequence (a, A, b, B, c, C), where a \le A, b \le B, c \le C, and -10^3 \le a, b, c, A, B, C \le 10^3.

Output

Output a single line containing the answer to the problem.

Examples

Example 1

Loading
Loading