#include <bits/stdc++.h>
using namespace std;
const int N=100000+5;
typedef long long ll;
int n,ans=0;
ll a[N]={0},l,r;
ll qzh[N]={0};
int main(){
freopen ("bjoi2016_hzss.in","r",stdin);
freopen ("bjoi2016_hzss.out","w",stdout);
scanf("%d%lld%lld",&n,&l,&r);
for (int i=1;i<=n;i++){
scanf("%lld",&a[i]);
qzh[i]=qzh[i-1]+a[i];
}
for (int i=1;i<=n;i++){
for (int j=1;j<=i;j++){
if (l<=qzh[i]-qzh[j-1]&&qzh[i]-qzh[j-1]<=r)ans++;
}
}
printf("%d\n",ans);
return 0;
}