#!/usr/bin/env python3 # %% import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines from math import gcd # %% N, L, H, *C = map(int, read().split()) # %% def lcm(x, y): return x * (y // gcd(x, y)) def f(H): LCM = [1] for x in C: LCM += [lcm(x, y) for y in LCM] A = [H // x for x in LCM] for i in range(N): for n in range(1 << N): if n & (1 << i): continue A[n] -= A[n ^ (1 << i)] return sum(A[1 << i] for i in range(N)) # %% answer = f(H) - f(L - 1) print(answer)