#include <bits/stdc++.h>
struct data {
  int x, y;
} b[200];
int main() {
  int n, i, j, cnt = 0, x = 0, y = 0;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d %d", &b[i].x, &b[i].y);
  for (i = 1; i <= n - 1; i++) {
    for (j = i + 1; j <= n; j++) {
      x = 0;
      y = 0;
      if (b[i].y >= 0 && b[i].x < b[j].x && b[i].x + b[i].y >= b[j].x) x++;
      if (b[i].y <= 0 && b[i].x >= b[j].x && b[i].x + b[i].y < b[j].x) x++;
      if (b[j].y >= 0 && b[j].x <= b[i].x + b[i].y &&
          b[j].x + b[j].y > b[i].x + b[i].y)
        x++;
      if (b[j].y <= 0 && b[j].x > b[i].x + b[i].y &&
          b[j].x + b[j].y <= b[i].x + b[i].y)
        x++;
      if (b[j].y >= 0 && b[j].x <= b[i].x && b[j].x + b[j].y > b[i].x) y++;
      if (b[j].y <= 0 && b[j].x > b[i].x && b[j].x + b[j].y <= b[i].x) y++;
      if (b[i].y >= 0 && b[i].x < b[j].x + b[j].y &&
          b[i].x + b[i].y >= b[j].x + b[j].y)
        y++;
      if (b[i].y <= 0 && b[i].x >= b[j].x + b[j].y &&
          b[i].x + b[i].y < b[j].x + b[j].y)
        y++;
      if (x > y)
        cnt += x;
      else
        cnt += y;
    }
  }
  printf("%d", cnt);
  return 0;
}
