#include <cstdio>
using namespace std;
int main(void)
{
freopen("fly.in","r",stdin);
freopen("fly.out","w",stdout);
int i,j,n,c=0,total=0,a[21]={0},s[21]={0};
scanf("%d",&n);
for (i=1;i<=n;i++)
{
scanf("%d",&a[i]);
s[i]=s[i-1]+a[i];
c+=a[i];
}
if ((c&1)==1)
return(0);
else
c=(c>>1);
for (i=1;i<n;i++)
for (j=i+1;j<=n;j++)
{
if (s[j]-s[i]==c)
total++;
}
total=(total*(total-1))>>1;
printf("%d\n",total);
return(0);
}