#include <bits/stdc++.h>
using namespace std;
struct Record {
  int before, later;
  int index;
  pair<int, int> getBefore() { return make_pair(before, -index); }
  pair<int, int> getLater() { return make_pair(later, -index); }
};
int n;
Record a[110];
int order(Record a, Record b) {
  if (a.getBefore() > b.getBefore()) return -order(b, a);
  if (b.getBefore() < a.getLater() && b.getBefore() < b.getLater() &&
      a.getLater() < b.getLater()) {
    return 1;
  } else if (a.getBefore() > b.getLater() && a.getBefore() > a.getLater() &&
             b.getLater() > a.getLater()) {
    return -1;
  } else {
    return 0;
  }
}
int adj[110][110];
int score[110];
int topo[110], topoId;
void visit(int u) {
  topo[u] = -1;
  for (int v = 1; v <= n; ++v) {
    if (adj[u][v] == 1 && topo[v] == 0) {
      visit(v);
    }
  }
  topo[u] = ++topoId;
}
bool cmp(int x, int y) { return topo[x] > topo[y]; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d", &a[i].before, &a[i].later);
    a[i].later += a[i].before;
    a[i].index = i;
    score[i] = a[i].before;
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      if (i != j) {
        adj[i][j] = order(a[i], a[j]);
      }
    }
  }
  topoId = 0;
  vector<int> id;
  for (int i = 1; i <= n; ++i) {
    if (topo[i] == 0) {
      visit(i);
    }
    id.push_back(i);
  }
  sort(id.begin(), id.end(), cmp);
  int noApplauses = 0;
  for (int i : id) {
    for (int j = 1; j <= n; ++j) {
      if (a[i].getBefore() < make_pair(score[j], -j) &&
          make_pair(score[j], -j) < a[i].getLater()) {
        ++noApplauses;
      } else if (a[i].getBefore() > make_pair(score[j], -j) &&
                 make_pair(score[j], -j) > a[i].getLater()) {
        ++noApplauses;
      }
    }
    score[i] = a[i].getLater().first;
  }
  printf("%d\n", noApplauses);
  return 0;
}
