n, X = [int(x) for x in input().split(' ')] nums = [int(x) for x in input().split(' ')] nums_count = {} count = 0 for i in nums: if i in nums_count: nums_count[i] += 1 else: nums_count[i] = 1 for i in nums_count.keys(): x = X - i if x in nums_count: count += nums_count[i] * nums_count[x] print(count)