N, X = gets.split.map(&:to_i) A = gets.split.map(&:to_i) C = A.tally C.default = 0 puts A.map { |a| C[X - a] }.sum