import itertools import numpy as np N, L, H = map(int, input().split()) A = tuple(map(int, input().split())) def solve(X): """ 1~Xまで""" res = 0 for i in range(1, N + 1): for t in itertools.combinations(A, i): l = np.lcm.reduce(t) res += (X // l) * i * (-1) ** (i - 1) return res print(solve(H) - solve(L - 1))