# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
import numpy as np

N = int(input())
array = list(map(int, input().split()))
dp = [0 for i in range(N)]
double_list = []
triple_list = []

for i in range(N):
    for j in range(i + 1, N):
        double_list.append(array[i] + array[j])
        for k in range(j + 1, N):
            triple_list.append(array[i] + array[j] + array[k])

double_list = np.array(double_list)
triple_list = np.array(triple_list)

print(len(np.where(double_list == 0)[0]) + len(np.where(triple_list == 0)[0]))