import math N,L,H = map(int,input().split()) # bit表現 lsC = list(map(int,input().split())) dp = [0]*(2**N) def ls_lcm(ls): ret = ls[0] for j in range(1,len(ls)): gcd = math.gcd(ret,ls[j]) ret = ret*ls[j]//gcd return ret for i in range(1,2**N): ll = [] for j in range(N): if (i >> j) & 1: ll.append(lsC[j]) lcm = ls_lcm(ll) cnt = H//lcm-(L-1)//lcm dp[i] = cnt # 包除原理で数え上げ ans = 0 for i in range(1,2**N): s = bin(i)[2:].count('1') if s % 2 == 1: ans += dp[i]*s else: ans -= dp[i]*s print(ans)