from collections import Counter n,x=map(int,input().split()) A=list(map(int,input().split())) cnt=Counter(A) ans=0 for a in A: ans+=cnt[x-a] print(ans)