import java.util.Arrays; import java.util.Comparator; import java.util.PriorityQueue; import java.util.Scanner; public class Main { public static void main(String[] args) { new Main().run(); } public void run() { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int L = sc.nextInt(); int H = sc.nextInt(); int[] C = new int[N]; for (int i = 0; i < N; ++i) { C[i] = sc.nextInt(); } System.out.println(f(H, C) - f(L - 1, C)); } int f(int upper, int[] C) { int n = C.length; int[] h = new int[1 << n]; for (int s = 1; s < 1 << n; ++s) { long lcm = 1; for (int i = 0; i < n; ++i) { if (((1 << i) & s) > 0) { lcm = lcm(lcm, C[i]); } } h[s] = (int) (upper / lcm); } for (int i = 0; i < n; ++i) { for (int s = 0; s < 1 << n; ++s) { if ((s & (1 << i)) > 0) { h[s] -= h[s ^ (1 << i)]; } } } for (int s = 0; s < 1 << n; ++s) { h[s] = (int) (Math.pow(-1, Integer.bitCount(s) + 1) * h[s]); } int ans = 0; for (int i = 0; i < n; ++i) { ans += h[(1 << n) - 1] - h[(1 << n) - 1 - (1 << i)]; } return ans; } long lcm(long a, long b) { return a / gcd(a, b) * b; } long gcd(long a, long b) { if (a < b) { long tmp = a; a = b; b = tmp; } long p = 1, q = 0, u = 0, v = 1; long x = a, y = b; while (y > 0) { p -= x / y * u; q -= x / y * v; x -= x / y * y; long tmp = p; p = u; u = tmp; tmp = q; q = v; v = tmp; tmp = x; x = y; y = tmp; } return x; } void tr(Object... objects) { System.out.println(Arrays.deepToString(objects)); } }