Tianjin University Online Judge
Contests Virtual Contests Problems Submit Runs Status Rank List Forum

3510.   A Min's Problem
Time Limit: 1.0 Seconds   Memory Limit: 65536K
Total Runs: 588   Accepted Runs: 248



There are M lights in a line. We code these lights in 1, 2, 3,......, M from left to right and every light is controlled by a line switch. At the beginning, all of lights are turning on. Otherwise there are M students joining in the experiment . The describe of the experiment as following.

The first student goes alone the lights from left to right and pull the switch lines which control those lights coded by the multiple of 1. Then the second student goes alone the lights from left to right and pull the switch lines which control those lights coded by the multiple of 2 . Then the third student goes alone the lights from left to right and pull the switch lines which control those lights coded by the multiple of 3 . By this way, we can draw a conclusion is that , in the last situation , the M student go alone the lights from left to right and pull the switch lines which control those lights coded by the multiple of M. Then ,Min has a problem, after the experiment, how much lights is turning on from the a-th light to the b-th light?

Input

There many cases. Each test case consists of three integer M (1 ≤ M ≤ 106), a,b (0 < abM), M is the number of lights .The last test case is followed by a line containing three zeros .

Output

For every case: output the number of working lights.

Sample Input

5 1 3
8 4 7
0 0 0

Sample Output

1
1



Source: TJRAC Team Selection 2010 (4)
Submit   List    Runs   Forum   Statistics

Tianjin University Online Judge v1.3.0
Maintance:Fxz. Developer: SuperHacker, G.D.Retop, Fxz