#include <bits/stdc++.h>
using namespace std;
const int inf = 0x20202020;
const long long mod = 1000000007;
const double eps = 1e-9;
const double pi = acos(-1);
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
const int N = 100;
int n;
int a[N + 5], b[N + 5];
int id[N + 5], seq[N + 5];
int c[N + 5];
bool seqcmp(int x, int y) {
  if (c[x] == c[y]) return x < y;
  return c[x] > c[y];
}
inline int getrank(int x) {
  for (int j = (0), j_end_ = (n); j < j_end_; ++j)
    if (seq[j] == x) return j;
  return 0;
}
int calc() {
  int res = 0;
  for (int i = (0), i_end_ = (n); i < i_end_; ++i) c[i] = a[i];
  sort(seq, seq + n, seqcmp);
  for (int i = (0), i_end_ = (n); i < i_end_; ++i) {
    int x = id[i];
    int pre = getrank(x);
    c[x] += b[x];
    sort(seq, seq + n, seqcmp);
    res += abs(pre - getrank(x));
  }
  return res;
}
bool cmp(int x, int y) {
  if ((b[x] >= 0) ^ (b[y] >= 0)) return b[x] > b[y];
  if (b[x] >= 0) {
    if (a[x] == a[y]) return x > y;
    return a[x] < a[y];
  } else {
    if (a[x] == a[y]) return x < y;
    return a[x] > a[y];
  }
}
int main() {
  scanf("%d", &n);
  for (int i = (0), i_end_ = (n); i < i_end_; ++i) scanf("%d %d", &a[i], &b[i]);
  for (int i = (0), i_end_ = (n); i < i_end_; ++i) id[i] = seq[i] = i;
  sort(id, id + n, cmp);
  printf("%d\n", calc());
  return 0;
}
