n, x = gets.split.map &:to_i a = gets.split.map &:to_i cnt = 0 for i in 0..n-1 do k = x - a[i] j = a.count(k) cnt += j end puts cnt