N,X=list(map(int,input().split())) a=list(map(int,input().split())) d={} for i in a: d[i]=0 for i in a: d[i]+=1 count=0 for i in d.keys(): if(i<=X and X-i in d): if(2*i==X): count+=d[i]+d[i]*(d[i]-1) else: count+=d[X-i]*d[i] print(count)