#include <stdio.h>
#include <stdlib.h>
int a[2000005];
int main()
{
    int n,k,i,j;
    double t;
    scanf ("%d%d",&n,&k);
    for (i=0;i<n;i++)scanf ("%d",&a[i]);
    int count=0,sum=0;
    for (i=0;i<n;i++) {sum=0;
            for (j=i;j<n;j++){sum+=a[j];t=sum*1.0/(j-i+1);
                if (t>=k) {count++;}
            }
    }
    printf ("%d\n",count);
    return 0;
}
