n, x = [int(s) for s in input().split(' ')] nums = sorted([int(s) for s in input().split(' ')]) count = 0 for indexs, i in enumerate(nums): for s in nums[index:]: if (i + s) == x: count += 1 elif (i + s) > x: break print(count)