#include <bits/stdc++.h>
int main() {
  int n, i, j;
  int a[31][31];
  int row[31], column[31];
  while (scanf("%d", &n) != EOF) {
    int sum = 0;
    memset(row, 0, sizeof(row));
    memset(column, 0, sizeof(column));
    for (i = 1; i <= n; i++) {
      for (j = 1; j <= n; j++) {
        scanf("%d", &a[i][j]);
      }
    }
    for (i = 1; i <= n; i++) {
      for (j = 1; j <= n; j++) {
        row[i] += a[i][j];
        column[i] += a[j][i];
      }
    }
    for (i = 1; i <= n; i++) {
      for (j = 1; j <= n; j++) {
        if (column[j] > row[i]) sum++;
      }
    }
    printf("%d\n", sum);
  }
  return 0;
}
