e-olymp
Competitions

Map data structure

Interesting Product

Find all possible values of product i * j, if the integer values of variables i and j vary for i from a to b and j from c to d (1a, b, c, d10).

Input

One line contains 4 numbers a, b, c and d (a can be greater than b, c can be greater than d).

Output

Print the number of possible product values.

Time limit 1 seconds
Memory limit 128 MiB
Input example #1
1 10 1 10
Output example #1
42
Source SFE-2010 Variant 16