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