#include <bits/stdc++.h>
using namespace std;
const int N = 110;
int n;
int score[N];
int a[N], d[N];
int Rank(int x) {
  int res = 1;
  for (int i = 0; i < n; i++) {
    if (score[i] > score[x]) res++;
  }
  return res;
}
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cin >> n;
  vector<pair<int, int>> v, vv;
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> d[i];
    a[i] *= 1000;
    a[i] += (n - i);
    score[i] = a[i];
    d[i] *= 1000;
    if (d[i] >= 0) {
      v.push_back(make_pair(a[i], i));
    } else {
      vv.push_back(make_pair(-a[i], i));
    }
  }
  sort(v.begin(), v.end());
  sort(vv.begin(), vv.end());
  int res = 0;
  for (int i = 0; i < v.size(); i++) {
    int x = Rank(v[i].second);
    score[v[i].second] += d[v[i].second];
    int y = Rank(v[i].second);
    res += abs(x - y);
  }
  for (int i = 0; i < vv.size(); i++) {
    int x = Rank(vv[i].second);
    score[vv[i].second] += d[vv[i].second];
    int y = Rank(vv[i].second);
    res += abs(x - y);
  }
  cout << res << endl;
}
