#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  vector<int> a(n), d(n);
  for (int i = 0; i < (n); i++) cin >> a[i] >> d[i];
  vector<int> inc, dec;
  for (int i = 0; i < (n); i++) (d[i] > 0 ? inc : dec).emplace_back(i);
  sort((inc).begin(), (inc).end(), [&](int i, int j) {
    return pair<int, int>(a[i], -i) < pair<int, int>(a[j], -j);
  });
  sort((dec).rbegin(), (dec).rend(), [&](int i, int j) {
    return pair<int, int>(a[i], -i) < pair<int, int>(a[j], -j);
  });
  vector<int> ord = inc;
  for (int p : dec) ord.push_back(p);
  int re = 0;
  for (int i : ord) {
    for (int j = 0; j < (n); j++)
      if (i != j &&
          (pair<int, int>(a[i], -i) < pair<int, int>(a[j], -j)) !=
              (pair<int, int>(a[i] + d[i], -i) < pair<int, int>(a[j], -j))) {
        ++re;
      }
    a[i] += d[i];
  }
  cout << re << endl;
  return 0;
}
