#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
const int INF = (int)(1e9 + 1337);
const long long LINF = (long long)(4e18);
const double EPS = 1e-11;
const int MAXN = 105;
int n;
int a[MAXN], d[MAXN];
pair<int, int> p[MAXN];
int ans;
bool fr[MAXN];
void init() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &a[i], &d[i]);
    a[i] *= -1;
    d[i] *= -1;
  }
}
void solve() {
  init();
  for (int i = 1; i <= n; i++) {
    p[i] = pair<int, int>(a[i], i);
  }
  sort(p + 1, p + n + 1);
  for (int i = 1; i <= n; i++) {
    if (d[p[i].second] >= 0 && !fr[p[i].second]) {
      fr[p[i].second] = true;
      p[i].first += d[p[i].second];
      int pos = i;
      while (pos < n && p[pos] > p[pos + 1]) {
        swap(p[pos], p[pos + 1]);
        pos++;
        ans++;
      }
      i--;
    }
  }
  for (int i = n; i >= 1; i--) {
    if (d[p[i].second] < 0 && !fr[p[i].second]) {
      fr[p[i].second] = true;
      p[i].first += d[p[i].second];
      int pos = i;
      while (pos > 1 && p[pos] < p[pos - 1]) {
        swap(p[pos], p[pos - 1]);
        pos--;
        ans++;
      }
      i++;
    }
  }
  printf("%d\n", ans);
}
int main() {
  srand(88);
  solve();
  return 0;
}
