ll n,x,a[1d5],r;
{
	rd(n,x,a(n));
	sort(a,a+n);
	rep(i,n)r+=upper_bound(a,a+n,x-a[i])-lower_bound(a,a+n,x-a[i]);
	wt(r);
}