from itertools import combinations from math import lcm N, L, H = map(int, input().split()) C = list(map(int, input().split())) def slv2(C, N, x): # N以下のxの倍数で、Cでは割り切れない数の個数 U = N // x any_div = 0 for i in range(1, len(C) + 1): for comb in combinations(C, i): l = lcm(*comb, x) if i % 2: any_div += N // l else: any_div -= N // l return U - any_div def slv(C, N): # N以下でCの元のうちただ1つだけで割り切れる数の個数 ans = 0 for i in range(len(C)): rem = [c for j, c in enumerate(C) if j != i] ans += slv2(rem, N, C[i]) return ans print(slv(C, H) - slv(C, L - 1))