Welcome to ZOJ Problem Sets Information Select Problem Runs Ranklist ZOJ Problem Set - 3224
Mathematics

Time Limit: 1 Second      Memory Limit: 32768 KB

Mathematics is always attractive. For example, Fourier Transform can split a normal function into parts with Sin function and Cos function, which shows magical properties. Log function can change a number in a huge range to a very small range. And Z-Transform can transform a complex signal into a new function to simplify the analysis.

Navi likes mathematics very much (Although he does not major in math). Especially he likes the Log function. Because with different base number chosen, a number n will be change to different number via function Log. What's more, he is currently considering numbers satisfying a special condition, which is, for a given number a, the number n is divisible by [Logan], where [n] means the greatest integer less then or equal to n.

Now Navi has generated some numbers and stored them in array a. He wants to find out the number of numbers n in interval [A, B] satisfying [Logain] is positive and n is divisible by [Logain], for all ai.

Input

There will be no more than 20 cases.
The first line of each case will be three integers N, A, B (1 <= N <= 500, 5 <= A <= B <= 231 - 1). The second line contains N numbers a1...aN, 2 <= ai <= 10000.

Output

One line per case, the number of numbers in [A, B] satisfying the condition above.

Sample Input

```1 6 6
2
2 5 14
2 3
```

Sample Output

```1
2
```

Author: ZHUANG, Junyuan
Source: ZOJ Monthly, July 2009
Submit    Status