n,x = map(int,input().split()) a = list(map(int,input().split())) a = sorted(a) import collections c = collections.Counter(a) e = c.most_common() ans = 0 for i in range(len(e)): b = e[i][0] d = x-b k = c[d] ans += e[i][1] * k print(ans)