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