#include <bits/stdc++.h>
int main() {
  int p[32][32];
  int n, i, j, r, x, y, s = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) scanf("%d", &p[i][j]);
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) {
      for (x = 0, y = 0, r = 0; r < n; r++) {
        x = x + p[i][r];
        y = y + p[r][j];
      }
      if (y > x) s++;
    }
  printf("%d\n", s);
  return 0;
}
