from collections import Counter N, X = map(int, input().split()) A = list(map(int, input().split())) C = Counter(A) ans = 0 for k, v in C.items(): ans += v * C[X-k] print(ans)