from functools import reduce from itertools import combinations n, L, H = map(int, input().split()) A = list(map(int, input().split())) def gcd(a, b): if b == 0: return a return gcd(b, a % b) def lcm(a, b): return a*(b//gcd(a, b)) ans = 0 for k in range(1, n+1): for subset in combinations(A, k): x = reduce(lcm, subset) ans += H//x*(-1)**(k-1)*k ans -= (L-1)//x*(-1)**(k-1)*k print(ans)