N,X =map(int,input().split()) l =[int(i) for i in input().split()] d ={i:0 for i in range(10**5+1)} n = 0 for i in l: d[i] += 1 for i in range(X+1): n += d[i] * d[X-i] print(n)