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] Y = set(Y) for i in range(N): if A[i] in Y: ans += 1 print(ans)