import sequtils,strutils,math proc p2(i : int): int= 1 shl i var N,L,H,i,p,cnt : int C,A : seq[int] (N,L,H) = stdin.readline.split.map(parseInt) C = stdin.readline.split.map(parseInt) cnt = 0 for c in C: cnt += H div c cnt -= (L - 1) div c for i in 0..p2(N): A = @[] for k in 0..N - 1: if (i and p2(k)) > 0: A.add(C[k]) if A.len > 1: p = 1 block hantei: for a in A: try: p = p * a div gcd(p, a) except: break hantei if A.len mod 2 == 0: cnt -= (H div p) * A.len cnt += ((L- 1) div p) * A.len else: cnt += (H div p) * A.len cnt -= ((L - 1) div p) * A.len echo cnt