from collections import Counter n, x = map(int, input().split()) a = list(map(int, input().split())) c = Counter(a) ans = 0 for i in a: ans += c[x - i] print(ans)