N, X = map(int,input().split()) Y = [0 for _ in range(N)] A = list(map(int,input().split())) ans = 0 for i in range(N): Y[i] = X-A[i] for i in range(N): if A[i] in Y:ans += Y.count(A[i]) print(ans)