#include <stdio.h>

int main(void)
{
	double num;
	
	scanf("%lf",&num);
    
    double vc[num];
	
	double count2;
	for (count2=1; count2<=num; count2++) {
	scanf("%lf",vc[count2]);
	putchar(' ');
	}
	
	putchar('\n');
	
	double count3,count4,count5;
	double d1,d2,d3;
	double sum;
	double counts=0;
	for (count3=1; count3<=num-2; count3++) {
		d1=vc[count3];
		for (count4=count3+1; count4<=num-1; count4++) {
			d2=vc[count4];
			for (count5=count4+1; count3<=num; count5++) {
			d3=vc[count5];
			
			sum=d1+d2+d3;
			
                if (sum==0)
                    counts++;
			}}}
			
			printf("%f", counts);
			
			return 0;
}