#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using ll = long long; #define rep(i,n) for(int i=0;i<(int)(n);i++) void chmax(ll &a,ll b){ if(a<b) a=b; } int main(){ int n,l,r; cin>>n>>l>>r; vector<ll> a(n); rep(i,n) cin>>a.at(i); sort(a.begin(),a.end()); auto isok=[&](ll x){ return l<=x&&x<=r; }; vector<vector<ll>> dp(n,vector<ll>(n,-1)); vector<vector<ll>> vmx(n,vector<ll>(n+1,-1)); rep(chs,n){ dp.at(chs).at(chs)=1; vmx.at(chs).at(chs+1)=1; rep(i,chs){ if(isok(a.at(i)*a.at(chs))){ ll up=chs; ll dw=i; while(up-dw>1){ ll md=(up+dw)/2; if(isok(a.at(md)*a.at(chs))) dw=md; else up=md; } ll g=vmx.at(i).at(up); chmax(dp.at(i).at(chs),g+1); chmax(vmx.at(i).at(chs+1),max(vmx.at(i).at(chs),g+1)); } } } ll ans=0; rep(i,n) rep(j,n){ chmax(ans,dp.at(i).at(j)); } cout<<ans<<endl; }