from collections import Counter N,X = map(int, input().split()) A = list(map(int, input().split())) cnt = Counter(A) ans = 0 for a in A: ans += cnt[X-a] print(ans)