from bisect import * N,X = map(int,input().split()) A = list(map(int,input().split())) A.sort() ans = 0 for i in range(N): b = bisect_left(A,X-A[i]) if A[i]+A[b] == X: ans += A.count(A[b]) print(ans)