N,X = map(int, input().split()) A = list(map(int, input().split())) ans = 0 for a in A: if X-a < 0: continue else: ans += A.count(X-a) print(ans)