n,x=map(int,input().split()) a=list(map(int,input().split())) c=0 for i in range(0,n): for s in range(0,n): if a[s]+a[i]==x and s!=t: c+=1 print(c)