#include <bits/stdc++.h>
using namespace std;
const int INF = 2000 * 1000 * 1000;
const long long LLINF = 1ll << 53;
template <class T>
void relaxmax(T& r, T v) {
  r = max(r, v);
}
template <class T>
void relaxmin(T& r, T v) {
  r = min(r, v);
}
template <class T>
using max_queue = priority_queue<T>;
template <class T>
using min_queue = priority_queue<T, vector<T>, greater<T>>;
const int MAXN = 100;
int n;
int a[MAXN], d[MAXN];
int score[MAXN];
int ans;
void unfreeze(int x) {
  for (int i = 0; i < n; ++i)
    if (i != x &&
        ((make_pair(score[i], n - i) < make_pair(score[x], n - x)) ^
         (make_pair(score[i], n - i) < make_pair(score[x] + d[x], n - x))))
      ans++;
  score[x] += d[x];
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d%d", &a[i], &d[i]);
  vector<int> ups, downs;
  for (int i = 0; i < n; ++i) {
    if (d[i] > 0)
      ups.push_back(i);
    else
      downs.push_back(i);
  }
  sort(ups.begin(), ups.end(), [&](int i, int j) {
    return make_pair(a[i], n - i) < make_pair(a[j], n - j);
  });
  sort(downs.begin(), downs.end(), [&](int i, int j) {
    return make_pair(a[i], n - i) > make_pair(a[j], n - j);
  });
  for (int i = 0; i < n; ++i) score[i] = a[i];
  for (int x : ups) unfreeze(x);
  for (int x : downs) unfreeze(x);
  printf("%d\n", ans);
}
