/*
TASK:sum
LANG:C++
*/
#include<iostream>
using namespace std;
int a[20],b[100000];
int main()
{
    int n,i,j,k,sum,last=-1;
    bool o;
    cin>>n;
    for(i=0;i<n;i++)
    {
      cin>>a[i];
    }
    if(n!=1)
    {
    for(i=0;i<n;i++)
    {
      for(j=i+1;j</*=*/n;j++)
      {
        for(int h=j;h<=n;h++)
        {
         sum=a[i];
         for(k=j;k<h;k++)
         {
          sum+=a[k];
         }
         o=1;
         for(k=0;k<=last;k++)
         {
          if(sum==b[k])
          {
           o=0;
           break;
          }
         }
         if(o)
         {
           last++;
           b[last]=sum;
         }
        }
      }
     
    }
    for(i=n-1;i>=0;i--)
    {
     for(j=i;j>=0;j--)
      {
        for(int h=j-1;h>=0;h--)
        {
         sum=a[i]; 
         
         if(j!=i)
          for(k=j;k>=h;k--)
          {
           sum+=a[k];
          }
         else
         {
          sum=0;
          for(k=j;k>=h;k--)
          {
           sum+=a[k];
          }
         }
         o=1;
         for(k=0;k<=last;k++)
         {
          if(sum==b[k])
          {
           o=0;
           break;
          }
         }
         if(o)
         {
           last++;
           b[last]=sum;
         }
        }
      }
    }  
    cout<<last+1<<endl;   
    }
    else
      cout<<"1"<<endl;
    return false;
}
