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