#include <bits/stdc++.h>
using namespace std;
inline void rd(int &x) {
  x = 0;
  char c;
  while (c = getchar(), c < 48)
    ;
  do x = x * 10 + (c & 15);
  while (c = getchar(), c > 47);
}
int n, ans;
struct ss {
  int old, add, id;
  bool operator<(const ss &A) const {
    if ((add >= 0) ^ (A.add >= 0)) return add > A.add;
    if (add < 0) {
      if (old == A.old) return id < A.id;
      return old > A.old;
    } else {
      if (old == A.old) return id > A.id;
      return old < A.old;
    }
  }
} A[105];
int chk(int old1, int id1, int old2, int id2) {
  if (old1 == old2) return id1 < id2;
  return old1 > old2;
}
int main() {
  scanf("%d", &n);
  for (int i = 1, a, b; i <= n; ++i) {
    scanf("%d %d", &A[i].old, &A[i].add);
    A[i].id = i;
  }
  sort(A + 1, A + 1 + n);
  for (int i = 1; i <= n; ++i) {
    int old = A[i].old;
    int ne = old + A[i].add;
    for (int j = 1; j <= n; ++j) {
      if (i == j) continue;
      if (chk(old, A[i].id, A[j].old, A[j].id) ^
          chk(ne, A[i].id, A[j].old, A[j].id))
        ans++;
    }
    A[i].old = ne;
  }
  printf("%d\n", ans);
  return 0;
}
