N,L,H = list(map(int, input().split(' '))) CS = list(map(int, input().split(' '))) from functools import reduce from fractions import gcd from itertools import combinations def lcm(*numbers): def lcm(a, b): return (a * b) // gcd(a, b) return reduce(lcm, numbers, 1) def pie(n, cs): total = 0 for i in range(1, len(cs)+1): for c in combinations(cs, i): total += pow(-1, i-1) * i * (n//lcm(*c)) return total print(pie(H, CS) - pie(L-1, CS))