from collections import Counter n, x = map(int, input().split()) a = list(map(int, input().split())) d = Counter(a) l = [d[x-i] for i in a] print(sum(l))