#include using namespace std; using ll = long long; #define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i)) #define all(x) (x).begin(),(x).end() #define pb push_back #define fi first #define se second #define dbg(x) cout<<#x" = "<<((x))< ostream& operator<<(ostream& o, const pair &p){o<<"("< ostream& operator<<(ostream& o, const vector &v){o<<"[";for(T t:v){o<>n >>L >>H; vector c(n); rep(i,n) cin >>c[i]; ll ans = 0; rep(mask,1<>i&1) { m = lcm(m,c[i]); if(m>H) break; } int b = __builtin_popcount(mask); if(b%2==0) b = -b; ans += b*(f(m,H)-f(m,L-1)); } cout << ans << endl; return 0; }