def gcd(a, b): while b: a, b = b, a%b return a def lcm(a, b): return a*b//gcd(a, b) def calc(n): res = 0 for i in range(2**N): l = 1 c = 0 for j in range(N): if (i>>j)&1: l = lcm(l, C[j]) c += 1 if c == 0: continue if c%2 == 1: res += n//l*c else: res -= n//l*c return res N, L, H = map(int, input().split()) C = list(map(int, input().split())) print(calc(H)-calc(L-1))