import java.util.*; public class Main { public static void main(String[] args) { 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(); } long ans = 0; for(int i = 0; i < N; i++) { // c[i]のみで割れる個数を求める long t = H / c[i] - (L - 1) / c[i]; long k = 0; for(int j = 1; j < (int)Math.pow(2, N); j++) { int count = 0; boolean flg = false; boolean over = true; long baisuu = 1; for(int l = 0; l < N; l++) { if((j & (1 << l)) != 0) { if(l == i) flg = true; count++; long g = gcd(baisuu, c[l]); baisuu *= (c[l] / g); if(baisuu > (long)Math.pow(10, 9)) { over = false; break; } } } if(over && flg && count > 1) { if(count % 2 == 1) { k -= (H / baisuu - (L - 1) / baisuu); } else { k += (H / baisuu - (L - 1) / baisuu); } } } ans += (t - k); } System.out.println(ans); } public static long gcd(long a, long b) { if(b == 0) return a; return gcd(b, a % b); } }