#include <bits/stdc++.h>
using namespace std;
int n;
bool vis[110];
struct People {
  int val, d, id;
} p[110];
bool operator<(const People& a, const People& b) {
  if (a.val != b.val) return a.val > b.val;
  return a.id < b.id;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d", &p[i].val, &p[i].d);
    p[i].id = i;
  }
  sort(p + 1, p + 1 + n);
  int ans = 0;
  for (int i = n; i >= 1; --i) {
    if (vis[p[i].id]) continue;
    if (p[i].d < 0) continue;
    vis[p[i].id] = 1;
    p[i].val += p[i].d;
    for (int j = i - 1; j; --j) {
      if (p[j + 1] < p[j]) {
        ans++;
        swap(p[j], p[j + 1]);
      } else
        break;
    }
    ++i;
  }
  for (int i = 1; i <= n; ++i) {
    if (vis[p[i].id]) continue;
    vis[p[i].id] = 1;
    p[i].val += p[i].d;
    for (int j = i + 1; j <= n; ++j) {
      if (p[j] < p[j - 1]) {
        ans++;
        swap(p[j - 1], p[j]);
      } else
        break;
    }
    --i;
  }
  printf("%d\n", ans);
  return 0;
}
