from bisect import * N, X = map(int, input().split()) A = list(map(int, input().split())) A.sort() B = set(A) ans = 0 for a in A: if X - a in B: pos1 = bisect_left(A, X - a) pos2 = bisect_right(A, X - a) - 1 ans += pos2 - pos1 + 1 print(ans)