let n = stdin.ReadLine() |>  int
let l = stdin.ReadLine().Split() |> Array.map int
let mutable ss = Set.ofArray (Array.zip l [|1..n|])
let mutable count = 0L

for i in 1..(n-2) do
 let (x,y) as a = Set.maxElement ss
 ss <- Set.remove a ss
 for (x_1,y_1) in ss do
  for (x_2,y_2) in ss do
   if x < x_1 + x_2 then count <- count + 1L
   else ()
  if x < x_1 + x_1 then count <- count - 1L else ()

count/2L
|>stdout.WriteLine