#include #define FOR(i,bg,ed) for(ll i=(bg);i<(ed);i++) #define REP(i,n) FOR(i,0,n) #define MOD 1000000007 #define int long long using namespace std; typedef long long ll; const int INF = 1e9; int N, L, H; int C[15]; int gcd(int a, int b) { if (b == 0) return a; return gcd(b, a % b); } int lcm(int a, int b) { return a / gcd(a, b) * b; } int nA(int A) { return H / A - (L - 1) / A; } int sum = 0; void rec(int i, int cnt, int tLcm) { if (i == N) { if (cnt % 2 == 0) { sum -= nA(tLcm); } else { sum += nA(tLcm); } return; } rec(i + 1, cnt + 1, lcm(tLcm, C[i])); rec(i + 1, cnt, tLcm); } signed main() { cin >> N >> L >> H; REP(i,N) cin >> C[i]; //cout << nA(5) << endl; /* REP(i,N) { sum += nA(C[i]); } */ rec(0, 1, 1); cout << sum << endl; }