n,x=map(int,input().split()) l=list(map(int,input().split())) c=0 for y in set(l): if x-y not in l: continue c+=l.count(y)*l.count(x-y) print(c)