n, x = [int(v) for v in input().split(" ")] nlist = [int(v) for v in input().split(" ")] s = 0 for i in range(n): s += (nlist.count(x-nlist[i])) print(s)