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