#include using namespace std; using i32 = int; using i64 = long long; const i32 sup = 2e9; int main() { i32 n, l, h; cin >> n >> l >> h; vector cs(n); for (auto& c : cs) cin >> c; auto get = [&](i32 x) { return h / x - (l - 1) / x; }; auto Lcm = [&](i32 a, i32 b) -> i32 { if (a / gcd(a, b) > sup / b) return sup; else return lcm(a, b); }; i32 ans = 0; for (i32 i = 0 ; i < n ; i++) { ans += get(cs[i]); for (i32 bit = 1 ; bit < (1 << n) ; bit++) { if (!(bit & (1 << i))) continue; if (__builtin_popcount(bit) == 1) continue; i32 mul = 1; for (i32 j = 0 ; j < n ; j++) { if (!(bit & (1 << j))) continue; mul = Lcm(mul, cs[j]); } // cout << get(mul) << endl; ans += (__builtin_popcount(bit) & 1 ? get(mul) : -get(mul)); } } cout << ans << endl; }