#include <bits/stdc++.h>
using namespace std;
int main() {
  long row;
  while (~scanf("%ld", &row)) {
    long i, j, aa[50][50] = {0}, rr[100] = {0}, cc[100] = {0}, v, t = 0, tk1;
    for (i = 0; i < row; i++) {
      for (j = 0; j < row; j++) {
        scanf("%ld", &aa[i][j]);
        rr[i] = rr[i] + aa[i][j];
        cc[j] = cc[j] + aa[i][j];
      }
    }
    for (i = 0; i < row; i++) {
      for (j = 0; j < row; j++) {
        if (cc[j] > rr[i]) t++;
      }
    }
    printf("%ld\n", t);
  }
  return 0;
}
