#include<iostream>
using namespace std;
const int N = 10010;
int n,m,a[N];
int ans = 0;
int main()
{
cin>>n>>m;
for(int i = 1; i<=n; i++)
{
int x; cin>>x;
a[i] = a[i-1]+x;
}
//枚举所有l,r的值
for(int l = 1; l<=n; l++)
{
for(int r = l; r<=n; r++)
{
if(a[r]-a[l-1]<=m) ans++;
else break;
}
}
cout<<ans;
return 0;
}