#include <bits/stdc++.h>
using namespace std;
struct Team {
  int a, d, i, place;
  bool isFrozen;
  bool operator<(const Team& other) const {
    int x = isFrozen ? a : a + d,
        otherX = other.isFrozen ? other.a : other.a + other.d;
    return x == otherX ? i < other.i : x > otherX;
  }
};
bool sortNegative(const Team& lhs, const Team& rhs) {
  return lhs.a == rhs.a ? (lhs.d == rhs.d ? lhs.i < rhs.i : lhs.d > rhs.d)
                        : lhs.a > rhs.a;
}
bool sortPositive(const Team& lhs, const Team& rhs) {
  return lhs.a == rhs.a ? (lhs.d == rhs.d ? lhs.i > rhs.i : lhs.d < rhs.d)
                        : lhs.a < rhs.a;
}
int main() {
  int n;
  Team teams[100];
  vector<Team> negative, positive;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> teams[i].a >> teams[i].d;
    teams[i].i = i;
    teams[i].isFrozen = true;
  }
  sort(teams, teams + n);
  for (int i = 0; i < n; i++) {
    teams[i].place = i;
    if (teams[i].d < 0)
      negative.push_back(teams[i]);
    else
      positive.push_back(teams[i]);
  }
  sort(negative.begin(), negative.end(), sortNegative);
  sort(positive.begin(), positive.end(), sortPositive);
  int ans = 0;
  for (int i = 0; i < positive.size(); i++) {
    int ind = positive[i].i;
    for (int j = 0; j < n; j++)
      if (teams[j].i == ind) {
        teams[j].isFrozen = false;
        break;
      }
    sort(teams, teams + n);
    for (int j = 0; j < n; j++) {
      if (teams[j].i == ind)
        ans += ((j - teams[j].place) > 0 ? (j - teams[j].place)
                                         : -(j - teams[j].place));
      teams[j].place = j;
    }
  }
  for (int i = 0; i < negative.size(); i++) {
    int ind = negative[i].i;
    for (int j = 0; j < n; j++)
      if (teams[j].i == ind) {
        teams[j].isFrozen = false;
        break;
      }
    sort(teams, teams + n);
    for (int j = 0; j < n; j++) {
      if (teams[j].i == ind)
        ans += ((j - teams[j].place) > 0 ? (j - teams[j].place)
                                         : -(j - teams[j].place));
      teams[j].place = j;
    }
  }
  cout << ans << endl;
  return 0;
}
