import collections N,X = map(int,input().split()) A = list(map(int,input().split())) C = collections.Counter(A) cnt = 0 for i in range(N): if X-A[i]>=0: cnt += C[X-A[i]] print(cnt)