#include using namespace std; using i64 = long long; #define rep(i,s,e) for(int (i) = (s);(i) <= (e);(i)++) #define all(x) x.begin(),x.end() i64 gcd(i64 a,i64 b){ if(b == 0) return a; return gcd(b,a % b); } int N; i64 L,H; vector C; i64 calc(i64 k){ i64 res = 0; for(int i = 1;i < (1 << N);i++){ i64 LCM = 1; for(int j = 0;j < N;j++){ if(i & (1 << j)){ LCM = LCM / gcd(LCM , C[j]) * C[j]; if(LCM > k) break; } } i64 p = __builtin_popcount(i); if(p & 1) res += (k / LCM) * p; else res -= (k / LCM) * p; } return res; } int main(){ cin >> N >> L >> H; C.resize(N); rep(i,0,N - 1) cin >> C[i]; cout << calc(H) - calc(L - 1) << endl; }