#include <bits/stdc++.h>
FILE *in, *out;
void dosya() {
  in = stdin;
  out = stdout;
}
int N, d[150][150];
void oku() {
  fscanf(in, "%d", &N);
  ;
  int i, j;
  for (i = 1; i <= N; i++)
    for (j = 1; j <= N; j++) fscanf(in, "%d", &d[i][j]);
  ;
}
void coz() {
  int i, j, top = 0, m, n, satir = 0, sutun = 0, yer;
  for (i = 1; i <= N; i++) {
    for (j = 1; j <= N; j++) {
      for (m = 1; m <= N; m++) satir += d[i][m];
      for (m = 1; m <= N; m++) sutun += d[m][j];
      if (sutun > satir) top++;
      satir = 0;
      sutun = 0;
    }
  }
  fprintf(out, "%d\n", top);
  ;
}
int main() {
  dosya();
  oku();
  coz();
  return 0;
}
