import fractions N, L, H = map(int, input().split()) Cs = list(map(int, input().split())) def solve(N, L, H, Cs): return solve_core(N, H, Cs) - solve_core(N, L - 1, Cs) def solve_core(N, H, Cs): if H == 0: return 0 ans = 0 for pat in range(1, 1 << N): lcm = calc_lcm(pat, Cs) n = bin(pat).count('1') ans += (-1) ** (n - 1) * (H // lcm) * n return ans def calc_lcm(pat, Cs): lcm = 1 for i, c in enumerate(Cs): if pat & (1 << i): lcm = lcm * c // fractions.gcd(lcm, c) return lcm print(solve(N, L, H, Cs))