from collections import Counter N, X = map(int, input().split()) cnt = Counter(map(int, input().split())) ans = sum(c * cnt[X-a] for a, c in cnt.items()) print(ans)