#include <bits/stdc++.h>
using namespace std;
template <class T>
void splitstr(const string &s, vector<T> &out) {
  istringstream in(s);
  out.clear();
  copy(istream_iterator<T>(in), istream_iterator<T>(), back_inserter(out));
}
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
static void redirect(int argc, const char **argv) {
  ios::sync_with_stdio(false);
  if (argc > 1) {
    static filebuf f;
    f.open(argv[1], ios::in);
    cin.rdbuf(&f);
    if (!cin) {
      cerr << "Failed to open '" << argv[1] << "'" << endl;
      exit(1);
    }
  }
  if (argc > 2) {
    static filebuf f;
    f.open(argv[2], ios::out | ios::trunc);
    cout.rdbuf(&f);
    if (!cout) {
      cerr << "Failed to open '" << argv[2] << "'" << endl;
    }
  }
}
struct team {
  int a;
  int d;
  int key() const {
    if (d >= 0)
      return a;
    else
      return -a;
  }
  bool operator<(const team &other) const { return key() < other.key(); }
};
int main(int argc, const char **argv) {
  redirect(argc, argv);
  int N;
  cin >> N;
  vector<team> teams(N);
  for (int i = 0; i < N; i++) {
    int a, d;
    cin >> a >> d;
    teams[i].a = a * 1000 - i;
    teams[i].d = d * 1000;
  }
  sort(begin(teams), end(teams));
  int ans = 0;
  for (int i = 0; i < N; i++)
    for (int j = 0; j < N; j++) {
      if (i == j) continue;
      int aj = (j < i) ? teams[j].a + teams[j].d : teams[j].a;
      if ((teams[i].a < aj) != (teams[i].a + teams[i].d < aj)) ans++;
    }
  cout << ans << '\n';
  return 0;
}
