from collections import Counter N, X = map(int, input().split()) A = sorted(map(int, input().split())) c = Counter(A) ans = 0 for a in A: if a > X: break ans += c[X-a] print(ans)