#include <bits/stdc++.h>
using namespace std;
int N;
pair<pair<int, int>, int> A[110];
int place(int x) {
  int res = 0;
  for (int i = 0; i < N; i++) {
    res += pair<int, int>(A[i].first.first, -A[i].second) <
           pair<int, int>(A[x].first.first, -A[x].second);
  }
  return res;
}
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    scanf("%d %d", &A[i].first.second, &A[i].first.first);
    A[i].first.first *= 1000;
    A[i].first.second = 1000 * A[i].first.second - i;
    A[i].second = i;
  }
  sort(A, A + N);
  int spl = 0;
  while (A[spl].first.first < 0) {
    spl++;
  }
  for (int i = 0; i < N; i++) {
    swap(A[i].first.first, A[i].first.second);
  }
  sort(A, A + spl, greater<pair<pair<int, int>, int> >());
  sort(A + spl, A + N);
  int ans = 0;
  for (int i = 0; i < N; i++) {
    int pl1 = place(i);
    A[i].first.first += A[i].first.second;
    int pl2 = place(i);
    ans += abs(pl1 - pl2);
  }
  printf("%d\n", ans);
}
