#include <bits/stdc++.h>
int a[32][32];
int main() {
  int n, i, j, k, sum1 = 0, sum2 = 0, m = 0;
  scanf("%d", &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 (k = 0; k < n; k++) {
        sum1 += a[i][k];
        sum2 += a[k][j];
      }
      if (sum1 < sum2) m++;
      sum1 = 0;
      sum2 = 0;
    }
  }
  printf("%d", m);
}
