N,L,H = map(int,input().split()) C = list(map(int,input().split())) def calc(x): return H // x - (L-1) // x def gcd(a,b): while True: r = a % b a = b b = r if r == 0:return a def lcm(a,b): return a * b // gcd(a,b) ans = 0 for bit in range(1,1 << N): d = 1 flag = True for i in range(N): if bit & (1 << i): d = lcm(d,C[i]) if d > H: flag = False break if flag: u = bin(bit).count('1') if u % 2 == 0: u = -u ans += u * calc(d) print(ans)