n,x = map(int, input().split()) a = list(map(int, input().split())) mxa=max(a) cnts=[0]*(mxa+1) for i in range(n): cnts[a[i]]+=1 ans=0 for i in range(mxa+1): nokori = x-i if 0<=nokori<=mxa: ans+=cnts[i]*cnts[nokori] print(ans)