N,X = map(int, input().split()) A = [int(a) for a in input().split()] M = max(A)+1 L = [0]*M for a in A: L[a] += 1 ans = 0 for i in range(M): if X-i >= M or X-i < 0: continue ans += L[i]*L[X-i] print(ans)