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