import 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;

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

  return m % mod;
}

void main() {
  int N = readln.chomp.to!int;
  int[][] AB;
  ulong M = 10UL^^9+7;


  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 += factorial(k, M) / 
        (factorial(AB[i][0] + AB[j][0], M) * factorial(AB[i][1] + AB[j][1], M));
    }
  }

  writeln(answer/2);
}
