import bisect N, X = map(int, input().split()) As = list(map(int, input().split())) As.sort() count = 0 for a in As: idx = bisect.bisect_left(As, X - a) loop = 0 while True: if idx + loop < N and As[idx + loop] == X - a: count += 1 loop += 1 else: break print(count)