# https://yukicoder.me/problems/no/546 import math def lcm(a, b): return a * b // math.gcd(a, b) n, l, h = map(int, input().split()) c = list(map(int, input().split())) def count(l, r, div): if l % div == 0: l -= 1 return r // div - l // div ans = 0 for k in range(n): A = count(l, h, c[k]) for i in range(1, 1<>k & 1) or bitcnt == 1: continue x = 1 for j in range(n): if i>>j & 1: x = lcm(x, c[j]) m = 1 if bitcnt % 2 == 0 else -1 A -= m * count(l, h, x) ans += A print(ans)