#include <stdio.h>

int main(void)
{
	int num;
	
	scanf("%d",&num);
	
	int count1;
	for (count1=1; count1<=num; count1++)
	int ncount1;
	
	int count2;
	for (count2=1; count2<=num; count2++) {
	scanf("%d",ncount2);
	putchar(' ');
	}
	
	putchar('\n');
	
	int count3,count4,count5;
	int d1,d2,d3;
	int sum;
	int counts=0;
	for (count3=1; count3<=num-2; count3++) {
		d1=ncount3;
		for (count4=count3+1; count4<=num-1; count4++) {
			d2=ncount4;
			for (count5=count4+1; count3<=num; count5++) {
			d3=ncount5;
			
			sum=d1+d2+d3;
			
                if (sum==0)
                    counts++;
			}}}
			
			printf("%d", counts);
			
			return 0;
}