ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules

NEERC 2009, Eastern subregional contest

About     Problems     Submit solution     Judge status     Standings
Contest is over

J. Summit Online Judge

Time limit: 0.5 second
Memory limit: 64 MB
The program committee of Yekaterinozavodsk programming contests decided to create a new website. In honor of the recent summit of the Harbin Cooperation Organization, they decided to name this website Summit Online Judge.
The website will contain a problem archive, which will be regularly extended with problems from contests held at this website. According to the current rules, the problem set of any contest must contain at least x and at most y problems.
The contests at the Summit Online Judge will be held often enough, which means that the number of problems in the archive will increase fast. For convenience, it was decided to divide the archive into volumes of equal size. The size of the volume is called correct if there is at least one way to hold several contests so that the total number of problems in these contests would be equal to the size of the volume. In addition, the size must be in the range from l to r.
Your task is to find the number of ways to choose a correct size of the volume.

Input

The only line contains four space-separated integers x, y, l, r (1 ≤ x, y, l, r ≤ 1018; xy; lr).

Output

Output the number of ways to choose a correct size of the volume.

Sample

inputoutput
4 5 7 13
5

Notes

In the example above, the size of the volume can be equal to 8, 9, 10, 12, or 13.
Problem Author: Alex Samsonov
Problem Source: NEERC 2009, Eastern subregional contest
To submit the solution for this problem go to the Problem set: 1720. Summit Online Judge