from collections import defaultdict N, X = map(int, input().split()) A = tuple(map(int, input().split())) D = defaultdict(int) for i in range(N): D[A[i]] += 1 res = 0 for k, v in D.items(): if X - k in D: res += D[X - k] * v print(res)