#include <bits/stdc++.h>
using namespace std;
double a[120], b[120];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%lf%lf", &a[i], &b[i]);
    a[i] += 1.0 * (n - i) / 120;
    b[i] += a[i];
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      if (b[i] > b[j] && b[j] > a[i] && a[i] > a[j])
        ans += 2;
      else if (b[j] > b[i] && b[i] > a[j] && a[j] > a[i])
        ans += 2;
      else if (a[i] > a[j] && a[j] > b[i] && b[i] > b[j])
        ans += 2;
      else if (a[j] > a[i] && a[i] > b[j] && b[j] > b[i])
        ans += 2;
      else if (a[i] > a[j] && b[i] < b[j])
        ans++;
      else if (a[i] < a[j] && b[i] > b[j])
        ans++;
    }
  }
  cout << ans << endl;
}
