import java.util.*; import java.io.*; public class Main { static int[] dp; public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] first = br.readLine().split(" ", 3); int n = Integer.parseInt(first[0]); int low = Integer.parseInt(first[1]) - 1; int high = Integer.parseInt(first[2]); String[] line = br.readLine().split(" ", n); int[] base = new int[n]; dp = new int[1 << n]; for (int i = 0; i < n; i++) { base[i] = Integer.parseInt(line[i]); dp[1 << i] = base[i]; } long total = 0; for (int i = 1; i < (1 << n); i++) { dp[i] = dfw(i); total += high / dp[i] * getCount(i); total -= low / dp[i] * getCount(i); } System.out.println(total); } static int getCount(int x) { int count = 0; while (x > 0) { count += (x & 1); x = x >> 1; } if (count % 2 == 0) { return -count; } else { return count; } } static int dfw(int key) { if (dp[key] != 0) { return dp[key]; } int x = 1; while (true) { if ((x & key) == x) { return dp[key] = getLCM(dfw(x), dfw(key ^ x)); } x = x << 1; } //return 0; } static int getLCM(int x, int y) { x /= gcd(x, y); if ((long) x * (long) y >= Integer.MAX_VALUE) { return Integer.MAX_VALUE; } else { return x * y; } } static int gcd(int x, int y) { if (x % y == 0) { return y; } else { return gcd(y, x % y); } } }