N,X=map(int,input().split()) A = list(map(int,input().split())) cnt = 0 for i in range(N): for j in range(N): if A[i]+A[j]==X: cnt+=1 print(cnt)