#include <bits/stdc++.h>
using namespace std;
int N, d[105];
pair<int, int> vec[105];
bool comp(pair<int, int> x, pair<int, int> y) {
  if (x.first == y.first) return x.second < y.second;
  return x.first > y.first;
}
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    scanf("%d %d", &vec[i].first, &d[i]);
    vec[i].second = i;
  }
  sort(vec, vec + N, comp);
  int ans = 0;
  for (int i = 0; i < N; i++)
    for (int j = i + 1; j < N; j++) {
      pair<int, int> x = vec[i], y = vec[j];
      x.first += d[vec[i].second];
      y.first += d[vec[j].second];
      if (!comp(x, y))
        ans++;
      else if (comp(vec[j], x) || comp(y, vec[i]))
        ans += 2;
    }
  printf("%d\n", ans);
  return 0;
}
