from collections import Counter n, x = map(int, input().split()) c = Counter(map(int, input().split())) ans = 0 for k, v in c.items(): if x - k in c: ans += c[k] * c[x - k] print(ans)