N,X=map(int,input().split()) a=list(map(int,input().split())) from collections import Counter b=Counter(a) ans=0 for i in range(N): ans+=b[X-a[i]] print(ans)