N,X =map(int,input().split()) M =10**5 l =[0]*(M+1) for i in input().split(): s = int(i) l[s] += 1 ans = 0 if X < M: for i in range(X+1): ans += l[i]*l[X-i] elif X <= 2*M: for i in range(X-M,M+1): ans += l[i]*l[X-i] print(ans)