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