Олимпиадный тренинг

Задача 21886. hall selection


Задача

Темы: Вывод формулы
For the opening ceremony of the Olympiad in Informatics, the organizers are looking for a suitable hall. The hall should have the shape of a rectangle, the length of each side of which is a positive integer.
In order for all participants of the ceremony to fit in the hall, and at the same time it does not look too empty, the area of ​​\u200b\u200bthe hall should be between A and B square meters, inclusive.
In order to place posters on the walls of the hall telling about the successes of schoolchildren at the Olympiads, but at the same time not to create the feeling that there are too few successes, the perimeter of the hall should be between C and D meters, inclusive.
Before making the final choice, the organizers of the Olympiad decided to look at one hall of each suitable size. Halls with dimensions Y × Z and Z.times. Y are considered the same. In order to understand the amount of work required to view the halls, the organizers asked how many different halls satisfy the above restrictions. It is required to write a program that, given A, B, C and D, determines the number of different halls, the area of ​​\u200b\u200bwhich is in the range from A to B, and the perimeter — from C to D, inclusive.

Input file format
The input file contains four space-separated integers: A, B, C, and D (1<=A<=B<=109 , 4<=C<=D<=109 ).
Output file format
The output file must contain a single number — desired number of halls.

Input:
2 10 4 8
Output:
3

Explanations for the example
In the example, the halls of the following sizes satisfy the constraints: 1 x times; 2.1 x 3.2 x 2