import std.conv, std.stdio, std.algorithm, std.string, std.range, std.math;

void main() {
  readln;
  const l = readln.split.map!(to!int).array;
  
  const n = l.length;
  int ans;
  foreach (a; 0..n) foreach (b; a+1..n) foreach (c; b+1..n) {
    if (l[a] < l[b]+l[c] && l[b] < l[c]+l[a] && l[c] < l[a]+l[b]) ++ans;
  }
  ans.writeln;
}