#include <bits/stdc++.h>
int N;
int list[200000];
int l[200000];
int r[200000];
int main() {
  scanf("%d", &N);
  int64_t s = 0;
  for (int i = 0; i < N; i++) {
    scanf(" %d", &list[i]);
    l[i] = s;
    s += list[i];
  }
  s = 0;
  for (int i = N - 1; i >= 0; i--) {
    r[i] = s;
    s += list[i];
  }
  int count = 0;
  for (int lp = 0; lp < N; lp++) {
    for (int rp = lp; rp < N; rp++) {
      if (l[lp] + r[rp] == s) count++;
    }
  }
  printf("%d\n", count);
  return 0;
}
