#include <bits/stdc++.h>
int main() {
  int n, i, j, csum = 0, rsum = 0, c = 0, x = 0;
  scanf("%d", &n);
  int a[n][n];
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      scanf("%d", &a[i][j]);
    }
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      for (x = 0; x < n; x++) {
        rsum += a[i][x];
        csum += a[x][j];
      }
      if (csum > rsum) {
        c++;
      }
      rsum = 0;
      csum = 0;
    }
  }
  printf("%d", c);
  return 0;
}
