#include <bits/stdc++.h>
using namespace std;
int n, m, x, y, z, k, w;
int a, b, ans;
struct node {
  int x, y, id;
  bool operator<(node const& T) const {
    if (T.x != x)
      return T.x > x;
    else
      return T.id < id;
  }
} A[105], B[105], C[105];
bool cmp(const node& a, const node& b) {
  if (a.x != b.x)
    return a.x > b.x;
  else
    return a.id < b.id;
}
int main() {
  scanf("%d", &n);
  for (int i = (0); i < (n); i++) {
    scanf("%d %d", &A[i].x, &A[i].y);
    A[i].id = i;
  }
  w = k = 0;
  for (int i = (0); i < (n); i++)
    if (A[i].y >= 0)
      B[w++] = A[i];
    else
      C[k++] = A[i];
  sort(B, B + w);
  sort(C, C + k, cmp);
  ans = 0;
  for (int i = (0); i < (w); i++) {
    for (int j = (0); j < (w); j++) {
      if (i == j) continue;
      if (B[j].x < B[i].x + B[i].y)
        x = 1;
      else if (B[j].x == B[i].x + B[i].y && B[j].id > B[i].id)
        x = 1;
      else
        x = 0;
      if (B[j].x > B[i].x)
        y = 1;
      else if (B[j].x == B[i].x && B[j].id < B[i].id)
        y = 1;
      else
        y = 0;
      ans += x * y;
    }
    B[i].x += B[i].y;
  }
  for (int i = (0); i < (k); i++) {
    for (int j = (0); j < (k); j++) {
      if (i == j) continue;
      if (C[j].x > C[i].x + C[i].y)
        x = 1;
      else if (C[j].x == C[i].x + C[i].y && C[j].id < C[i].id)
        x = 1;
      else
        x = 0;
      if (C[j].x < C[i].x)
        y = 1;
      else if (C[j].x == C[i].x && C[j].id > C[i].id)
        y = 1;
      else
        y = 0;
      ans += x * y;
    }
    C[i].x += C[i].y;
  }
  w = k = 0;
  for (int i = (0); i < (n); i++)
    if (A[i].y >= 0)
      B[w++] = A[i];
    else
      C[k++] = A[i];
  for (int i = (0); i < (w); i++)
    for (int j = (0); j < (k); j++) {
      if (B[i].x < C[j].x)
        x = 1;
      else if (B[i].x == C[j].x && B[i].id > C[j].id)
        x = 1;
      else
        x = 0;
      if (B[i].x + B[i].y > C[j].x + C[j].y)
        y = 1;
      else if (B[i].x + B[i].y == C[j].x + C[j].y && B[i].id < C[j].id)
        y = 1;
      else
        y = 0;
      ans += x * y;
    }
  printf("%d\n", ans);
  return 0;
}
