#include<iostream>
#include<algorithm>
using namespace std;
int n,l,r,w[64],hzh[64];
long long tot = 0;
void DFS(int x,int y){
if(x+1==n){
tot++;
return ;
}
if(y+hzh[x]<l)return ;
if(y>r)return ;
if(x>n)return ;
DFS(x+1,y+w[x]);
DFS(x+1,y);
}
int main(){
cin>>n>>l>>r;
for(int i = 1;i<=n;i++)cin>>w[i];
sort(w+1,w+1+n);
for(int i = n;i>=1;i--)hzh[i] = hzh[i+1]+w[i];
DFS(1,0);
cout<<tot;
return 0;
}