#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;int n,s,mx,p,ans=0;
double a[200010]={0};
int main()
{
freopen("costume.in","r",stdin);
freopen("costume.out","w",stdout);
cin>>n>>s;
for (int i=1;i<=n;i++)
{
cin>>a[i];
if (mx<a[i]) mx=a[i];
}
sort(a+1,a+1+n);
for (int i=1;i<=n;i++)a[i]-=s/2.0;
p=lower_bound(a+1,a+1+n,0)-a;
for (int i=p;i<=n;i++)
{
int hi=lower_bound(a+1,a+n+1,-1*a[i])-a;
while (a[hi]==a[i]*-1&&hi<i) hi++;
ans+=(i-hi);
}
long long nn=n*(n-1)/2;
cout<<nn-ans;
}