#include <bits/stdc++.h>
using namespace std;
struct W {
  int id, v, d;
  bool operator<(const W &a) const {
    if (v != a.v) return v > a.v;
    return id < a.id;
  }
} Q[105];
int val[105][105];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d %d", &Q[i].v, &Q[i].d), Q[i].id = i;
  int ans = 0;
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++) {
      W a = Q[i], b = Q[j], c = Q[i], d = Q[j];
      c.v += c.d, d.v += d.d;
      if (a < b && b < c || b < a && c < b) val[i][j]++;
      if (c < b && d < c || b < c && c < d) val[i][j]++;
      if (a < b && d < a || b < a && a < d) val[j][i]++;
      if (d < a && c < d || a < d && d < c) val[j][i]++;
      ans += max(val[i][j], val[j][i]);
    }
  printf("%d\n", ans);
  return 0;
}
