def solve(lines): _, X = int(lines[0].split(" ")[0]), int(lines[0].split(" ")[1]) a = [int(a) for a in lines[1].split(" ")] comps = set() count = 0 for ai in a: comps.add(X - ai) for ai in a: if ai in comps: count += 1 return count if __name__ == "__main__": solve([input(), input()])