import std.functional,
       std.algorithm,
       std.string,
       std.array,
       std.range,
       std.stdio,
       std.conv;

ulong factorial(ulong n, ulong mod) {
  if (n == 0) {
    return 1;
  } else if (n == 1) {
    return 1;
  }
  ulong m = 1;
  ulong _n = n;

  for (; n > 1; n--) {
    m *= n % mod;
  }

  return m;
}

void main() {
  
  int n = readln.chomp.to!int;
  int[][] ab;
  
  ulong m = 10UL^^9+7;

  alias mfactorial = memoize!factorial;
  
  foreach (_; n.iota) {
    ab ~= readln.chomp.split.to!(int[]);
  }

  ulong answer;

  foreach (i; n.iota) {
    foreach (j; n.iota) {
      if (i == j) continue;
      ulong k = ab[i].sum + ab[j].sum;
      answer += mfactorial(k, m) / 
        (mfactorial(ab[i][0] + ab[j][0], m) * mfactorial(ab[i][1] + ab[j][1], m));
    }
  }

  writeln(answer/2);
}
