from math import lcm def popcount(n): cnt = 0 while n: cnt += n & 1 n >>= 1 return cnt N, L, H = map(int, input().split()) C = list(map(int, input().split())) ans = 0 N2 = 1 << N for s in range(1, N2): cnt = 0 val = 1 for i in range(N): if (s >> i) & 1: cnt += 1 val = lcm(val, C[i]) if val > H: break ans += (H//val - (L - 1)//val) * (-1) ** (cnt + 1) * cnt print(ans)