import math from collections import deque N, L, H = map(int, input().split()) C = list(map(int, input().split())) def calc(n): ret = deque() cnt = 0 while n > 0: if n & 1: ret.append(C[cnt]) n >>= 1 cnt += 1 return ret ans = 0 for i in range(1, 1 << N): d = calc(i) num = len(d) if num == 1: v = d.pop() ans += H // v - (L-1) // v continue while len(d) > 1: v1 = d.pop() v2 = d.pop() d.append(v1*v2//math.gcd(v1,v2)) v = d.pop() if num % 2 == 1: ans += (H // v - (L-1) // v)*num else: ans -= (H // v - (L-1) // v)*num print(ans)