from math import gcd N, L, H = map(int, input().split()) C = tuple(list(map(int, input().split()))) def enum(v): return H // v - (L - 1) // v dp = [0] * N for S in range(1, 1 << N): lcm = 1 coef = -1 for i, c in enumerate(C): if (S >> i) & 1: lcm = lcm // gcd(lcm, c) * c coef *= -1 cnt = enum(lcm) for i in range(N): if (S >> i) & 1: dp[i] += coef * cnt print(sum(dp))