n, x = [ int(v) for v in input().split() ] number_list = [ int(v) for v in input().split() ] setlist = list(set(number_list)) countlist = [ number_list.count(i) for i in setlist] s = 0 for i in setlist: if x - i in setlist: t = (number_list.count(i)*number_list.count(x-i)) if x - i == i: s += t else: s += 2*t if i >= x//2: break print(s)