N,X = map(int,input().split()) A = list(map(int,input().split())) C = {} for i in range(N): if A[i] not in C: C[A[i]] = 0 C[A[i]] += 1 cnt = 0 for i in range(N): a = A[i] if X-a in C: if X-a!=a: cnt += C[X-a] else: cnt += C[a] print(cnt)