#include <bits/stdc++.h>
using namespace std;
using uint = unsigned;
using lint = long long;
using ulint = unsigned long long;
using ldouble = long double;
using point = complex<double>;
using doublex = complex<ldouble>;
const double E = 1e-9, pi = 2 * acos(0);
const ldouble PI = 2 * acosl(0);
bool solve(int testNumber) {
  int n;
  if (scanf("%d", &n) == EOF) return false;
  vector<int> A(n), D(n);
  for (int i = 0; i < n; i++) scanf("%d %d", &A[i], &D[i]);
  int ans = 0;
  auto cmp = [&](int i, bool ti, int j, bool tj) {
    int a = A[i] + (ti ? D[i] : 0), b = A[j] + (tj ? D[j] : 0);
    if (a != b) return a > b;
    return i < j;
  };
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) {
      vector<int> id = {0, 1, 2, 3};
      vector<int> vetI = {i, i, j, j};
      vector<bool> vetB = {false, true, false, true};
      do {
        bool valid = true;
        for (int k = 0; k < 4; k++)
          for (int l = k + 1; l < 4; l++)
            if ((id[k] < id[l]) != cmp(vetI[k], vetB[k], vetI[l], vetB[l]))
              valid = false;
        if (valid) break;
      } while (next_permutation(id.begin(), id.end()));
      int a = id[0], b = id[1], c = id[2], d = id[3];
      bool flag = (a < b) == (c < d);
      if (a > b) swap(a, b);
      if (c > d) swap(c, d);
      if (a > c) {
        swap(a, c);
        swap(b, d);
      }
      if (b > d)
        ans++;
      else if (b > c)
        ans += 1 + flag;
    }
  printf("%d\n", ans);
  return true;
}
void init() {}
int main() {
  init();
  for (int i = 1; solve(i); i++)
    ;
  return 0;
}
