import java.io.FileNotFoundException; import java.util.Arrays; import java.util.HashSet; import java.util.Scanner; public class Main { public static void main(String[] args) throws FileNotFoundException { new Main().run(); } void run() { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long L = sc.nextLong(); long H = sc.nextLong(); long[] c = new long[n]; for (int i = 0; i < n; ++i) { c[i] = sc.nextLong(); } System.out.println(calc(H, c, n) - calc(L - 1, c, n)); } long calc(long v, long[] c, int n) { long ans = 0; out: for (int s = 1; s < 1 << n; ++s) { long f = 1; for (int i = 0; i < n; ++i) { if ((s & (1L << i)) > 0) { f = lcm(f, c[i]); if (f < 0) { continue out; } } } if (Integer.bitCount(s) % 2 == 1) { ans += v / f * Integer.bitCount(s); } else { ans -= v / f * Integer.bitCount(s); } } 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; } if (b == 0) { return a; } return gcd(a % b, b); } void tr(Object... objects) { System.out.println(Arrays.deepToString(objects)); } }