#define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define eps 0.000001 #define LONG_INF 10000000000000 #define GOLD 1.61803398874989484820458 #define seg_size 65536*4 #define REP(i,n) for(long long i = 0;i < n;++i) unsigned long xor128() { static unsigned long x = time(NULL), y = 362436069, z = 521288629, w = 88675123; unsigned long t = (x ^ (x << 11)); x = y; y = z; z = w; return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8))); } int main(){ #define int long long int n,l,h; cin >> n >> l >> h; vector a; REP(i,n){ int b; cin >> b; a.push_back(b); } long long ans = 0; for(int i = 1;i < (1 << n);++i){ int tea = 0; long long hoge = 0; long long nya = 1; int now = i; for(int q = 0;now != 0;++q){ if(now % 2 == 1){ nya *= a[q]; tea++; if(nya > h) break; } now /= 2; } hoge = h / nya - l / nya; if(tea % 2 == 1){ ans += tea * hoge; }else{ ans -= tea * hoge; } } cout << ans << endl; return 0; }