ans=0 cnt={} N,X=map(int,input().split()) a=list(map(int,input().split())) for i in a: if i in cnt: cnt[i]+=1 else: cnt[i]=1 for i in cnt: if (X-i) in cnt: ans+=cnt[i]*cnt[X-i] print(ans)