gets
ls = gets.split.map{|v| v.to_i}

len = ls.length

sorted_ls = ls.sort.reverse

def is_trianglable(a, b, c)
  return (a < b + c) && (b < c + a) && (c < a + b)
end

cnt = 0

0.upto(len - 1) do |idx|
  cur = sorted_ls[idx]
  (idx+1).upto(len - 1) do |jdx|
    (jdx+1).upto(len - 1) do |kdx|
      a = cur
      b = sorted_ls[jdx]
      c = sorted_ls[kdx]
      if is_trianglable(a, b, c)
        cnt += 1
      end
    end
  end
end

puts cnt