n, x = map(int, input().split())
a = list(map(int, input().split()))

from collections import Counter

freq = Counter(a)
result = 0

for num in a:
    complement = x - num
    result += freq.get(complement, 0)

print(result)