#include<iostream>
#include<cstdio>
#include<cstdlib>
using namespace std;
int q[21]={0};
int n,answer=0,m=0;
int main()
{
freopen ("fly.in","r",stdin);
freopen ("fly.out","w",stdout);
cin>>n;
for (int i=1;i<=n;i++)
{
int a;
cin>>a;
q[i]=q[i-1]+a;
m+=a;
}
for (int i=1;i<=n;i++)
{
for (int j=1;j<=n;j++)
{
if (i==j)
continue;
int a,b;
a=q[i];
b=q[j];
if (a>b)
{
if (a-b==m/2)
answer++;
}
if (b>a)
{
if (b-a==m/2)
answer++;
}
}
}
answer/=2;
cout<<(answer*(answer-1))/2;
return 0;
}