#include <bits/stdc++.h>
using namespace std;
int init[100 + 5], more[100 + 5];
int max(int u, int v) { return u > v ? u : v; }
int isBetter(int pos_p, int point_p, int pos_q, int point_q) {
  if (point_p > point_q) return true;
  if (point_p == point_q) return (pos_p < pos_q);
  return false;
}
int F(int p, int q) {
  int ret = 0;
  int new_p = init[p] + more[p];
  int new_q = init[q] + more[q];
  if (isBetter(p, init[p], q, init[q]) == false &&
      isBetter(p, new_p, q, init[q]) == true)
    ret++;
  if (isBetter(p, init[p], q, init[q]) == true &&
      isBetter(p, new_p, q, init[q]) == false)
    ret++;
  if (isBetter(q, init[q], p, new_p) == false &&
      isBetter(q, new_q, p, new_p) == true)
    ret++;
  if (isBetter(q, init[q], p, new_p) == true &&
      isBetter(q, new_q, p, new_p) == false)
    ret++;
  return ret;
}
int main() {
  int i, j, k, n, ans = 0;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d %d", &init[i], &more[i]);
  for (i = 1; i <= n; i++)
    for (j = i + 1; j <= n; j++) ans += max(F(i, j), F(j, i));
  printf("%d\n", ans);
  return 0;
}
