#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  vector<int> x(N);
  vector<int> y(N);
  for(int i=0;i<N;i++){
    cin >> x.at(i);
    cin >> y.at(i);
  }

  int num = 0;
  float delx = 0;
  float dely = 0;
  for(int j=0;j<N;j++){
    for(int k=j+1;k<N;k++){
      dely = y.at(j) - y.at(k);
      delx = x.at(j) - x.at(k);
      if((dely / delx )>=-1){
        if((dely / delx )<=1){
          num ++;
        }
      }
    }
  }
  cout << num;
}
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; (i) < (int)(n); ++(i))
#define REP3(i, m, n) for (int i = (m); (i) < (int)(n); ++(i))
#define REP_R(i, n) for (int i = (int)(n)-1; (i) >= 0; --(i))
#define REP3R(i, m, n) for (int i = (int)(n)-1; (i) >= (int)(m); --(i))
#define ALL(x) ::std::begin(x), ::std::end(x)
using namespace std;

int64_t solve(int n, const std::vector<int64_t> &a) {
    int64_t ans = 0;
    int64_t b = 0;
    map<int64_t, int> c;
    c[0] += 1;
    REP (i, n) {
        b += (i % 2 == 0 ? a[i] : - a[i]);
        ans += (c.count(b) ? c[b] : 0);
        c[b] += 1;
    }
    return ans;
}

// generated by oj-template v4.8.0 (https://github.com/online-judge-tools/template-generator)
int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    int N;
    std::cin >> N;
    std::vector<int64_t> A(N);
    REP (i, N) { std::cin >> A[i]; }
    auto ans = solve(N, A);
    std::cout << ans << '\n';
    return 0;
}
