let i_inp_list : unit -> int list = fun () ->
  let inp_split = Str.split (Str.regexp " ") (input_line stdin) in
  List.map (fun x -> int_of_string x) (inp_split)

  
let rec pairs : 'a list -> ('a * 'a) list = function
    [] -> []
  | x :: xs -> List.map (fun y -> (x, y)) xs @ (pairs xs)
             
let rec t_pairs : 'a list -> ('a * 'a * 'a) list = function
    [] -> []
  | x :: xs ->
     let rec sub = function
         [] -> []
       | y :: ys ->
          List.map (fun z -> (x, y, z)) ys @ (sub ys)
     in
     sub xs @ t_pairs xs
  
let () =
  let _ = Scanf.sscanf (input_line stdin) "%d" (fun n -> n) in
  let l = i_inp_list () in
  let p = t_pairs l in
  let ans = List.fold_right (fun (a, b, c) s -> if a < b + c && b < c + a && c < a + b then s + 1 else s ) p 0
  in
  print_int ans;
  print_newline ()
