from collections import defaultdict def main(): N, X = map(int, input().split()) A = list(map(int, input().split())) A.sort() counter_A = defaultdict(int) for num in A: counter_A[num] += 1 patterns = 0 for num in A: if num > X - num: break if num == X - num: patterns += counter_A[num] ** 2 break patterns += counter_A[num] * counter_A[X - num] * 2 print(patterns) if __name__ == "__main__": main()