N,X=map(int,input().split()) A=list(map(int,input().split())) from collections import Counter C=Counter(A) ANS=0 for i in range(10**5+1): k=X-i if k==i: ANS+=C[i]*C[i] else: ANS+=C[i]*C[k] print(ANS)