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