from collections import Counter N,X = map(int, input().split()) A = list(map(int, input().split())) C = Counter(A) print(sum([C[X-a] for a in A]))