N,X =map(int,input().split()) l =[int(i) for i in input().split()] n = 0 for i in l: n += l.count(X-i) print(n)