#include <bits/stdc++.h>
using namespace std;
class Yuan {
 public:
  int id;
  int fre;
  int bian;

 public:
  bool operator<(const Yuan &t) const {
    if (fre != t.fre)
      return fre < t.fre;
    else
      return id > t.id;
  }
  bool operator>(const Yuan &t) const {
    if (fre != t.fre)
      return fre > t.fre;
    else
      return id < t.id;
  }
  Yuan() {
    bian = 0;
    id = 0;
    fre = 0;
  }
  Yuan(int ii, int ff) {
    bian = 0;
    id = ii;
    fre = ff;
  }
} yuan[200];
int get(Yuan a, Yuan b) {
  Yuan aa(a.id, a.fre + a.bian), bb(b.id, b.fre + b.bian);
  int ans = 0;
  if (aa < b && bb < aa) ans = max(ans, 2);
  if (aa < b && bb > aa) ans = max(ans, 1);
  if (aa > b && bb < aa) ans = max(ans, 0);
  if (aa > b && bb > aa) ans = max(ans, 1);
  if (bb > a && aa < bb) ans = max(ans, 1);
  if (bb > a && aa > bb) ans = max(ans, 2);
  if (bb < a && aa < bb) ans = max(ans, 1);
  if (bb < a && aa > bb) ans = max(ans, 0);
  return ans;
}
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    for (int i = 1; i <= n; i++) {
      scanf("%d%d", &yuan[i].fre, &yuan[i].bian);
      yuan[i].id = i;
    }
    sort(yuan + 1, yuan + n + 1);
    int res = 0;
    for (int i = 1; i <= n - 1; i++) {
      for (int w = i + 1; w <= n; w++) {
        res += get(yuan[w], yuan[i]);
      }
    }
    printf("%d\n", res);
  }
}
