#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#define eps 1e-10

long r[250];

int cmp (const void *a, const void *b) {
	return *((long *)a)<*((long *)b)?1:-1;
}
inline long sqr(long x) {
	return x*x;
}
inline double sqr(double x) {
	return x*x;
}
inline void getcoo (double &x, double &y, long i, long j, long k) {
	x=(sqr(r[i]+r[j])+sqr(r[i]+r[k])-sqr(r[j]+r[k]))/(2.0*(r[i]+r[j]));
	y=sqrt(sqr(r[i]+r[k])-x*x);
}


int main () {

	freopen ("packing.in","r",stdin);
	freopen ("packing.out","w",stdout);

	long i,j,k,n,ii;

	scanf ("%ld",&n);

	if (n<4) return printf ("0")-1;

	for (i=0;i<n;i++) scanf ("%ld",&r[i]);

	qsort (r,n,sizeof(r[0]),cmp);

	for (i=0;i<n-1;i++) if (r[i]==r[i+1]) { printf ("Botva! (odinakovie)\n"); break; }

	long result=0;

	for (i=0;i<n;i++)
		for (j=i+1;j<n;j++) {
			ii=n-2;
			for (k=n-1;k>j+1;k--) {
				if (ii>=k) ii=k-1;
				double x,y;
				getcoo(x,y,i,j,k);
				while (ii>j) {
					double xx,yy;
					getcoo (xx,yy,i,j,ii);
					if (sqr(xx-x)+sqr(yy-y)+eps>=1.0*sqr(r[ii]+r[k])) {
						result+=(ii-j);
						break;
					}
					ii--;
				}
			}
		}

	printf ("%ld",result);

	return 0;
}