#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
long long llinf = 1e18 + 10;
int intinf = 1e9 + 7;
const long long mod = 1e9 + 7;
const int N = 211;
int a[N], b[N];
int c[N][N];
int n;
set<int> to[N];
int sz[N];
bool comp(pair<int, int> x, pair<int, int> y) { return x < y; }
void conn(int i, int j) {
  pair<int, int> x = {a[i], -i}, y = {a[j], -j};
  pair<int, int> X = {b[i], -i}, Y = {b[j], -j};
  if (comp(x, y) && comp(y, X) && comp(X, Y)) c[i][j] = 1;
  if (comp(Y, X) && comp(X, y) && comp(y, x)) c[i][j] = 1;
  if (comp(y, x) && comp(x, Y) && comp(Y, X)) c[j][i] = 1;
  if (comp(X, Y) && comp(Y, x) && comp(x, y)) c[j][i] = 1;
}
int main() {
  scanf("%d", &(n));
  for (int i = 0; i < int(n); ++i) {
    int d;
    scanf("%d%d", &(a[i]), &(d));
    b[i] = a[i] + d;
  }
  for (int i = 0; i < int(n); ++i) {
    for (int j = i + 1; j < n; j++) {
      conn(i, j);
    }
  }
  for (int k = 0; k < int(n); ++k)
    for (int i = 0; i < int(n); ++i)
      for (int j = 0; j < int(n); ++j)
        if (i != j) c[i][j] = c[i][j] || (c[i][k] && c[k][j]);
  for (int i = 0; i < int(n); ++i)
    for (int j = 0; j < int(n); ++j)
      if (c[i][j]) {
        to[i].insert(j), sz[i]++;
      }
  vector<int> ans;
  for (int i = 0; i < int(n); ++i) {
    int j = max_element(sz, sz + n) - sz;
    ans.push_back(j);
    sz[j] = -1;
  }
  int pr = 0;
  for (int i = 0; i < int(n); ++i) {
    int j = ans[i];
    for (int k = 0; k < int(n); ++k)
      if (k != j) {
        pair<int, int> y = {a[k], -k};
        pair<int, int> x = {min(a[j], b[j]), -j}, X = {max(b[j], a[j]), -j};
        if (comp(x, y) && comp(y, X)) {
          pr++;
        }
      }
    a[j] = b[j];
  }
  cout << pr << endl;
  return 0;
}
