import collections N, X = map(int,input().split()) A = list(map(int,input().split())) C = collections.Counter(A) ans = 0 for i in range(10 ** 5 + 1): if X == 2 * i: ans += C[i] ** 2 else: ans += C[i]* C[X - i] print(ans)