#include <bits/stdc++.h>
using namespace std;
int n;
pair<int, int> a[200];
int cmp(pair<int, int> x, pair<int, int> y) {
  return x.first > y.first || x.first == y.first && x.second < y.second;
}
int check(pair<int, int> my_range, int oppo_point, int my_pos, int oppo_pos) {
  return cmp(make_pair(my_range.first, my_pos),
             make_pair(oppo_point, oppo_pos)) ^
         cmp(make_pair(my_range.second, my_pos),
             make_pair(oppo_point, oppo_pos));
}
int calc(int x, int y) {
  pair<int, int> val_x = a[x], val_y = a[y];
  return check(val_x, val_y.first, x, y) + check(val_y, val_x.second, y, x);
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i].first >> a[i].second;
    a[i].second += a[i].first;
  }
  int ans = 0;
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) {
      ans += max(calc(i, j), calc(j, i));
    }
  cout << ans << endl;
  return 0;
}
