#include <bits/stdc++.h>
int main() {
  int n, count = 0;
  scanf("%d", &n);
  int input[n][n];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      scanf("%d", &input[i][j]);
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      int sumrow = 0, sumcolumn = 0;
      for (int k = 0; k < n; k++) {
        sumrow += input[i][k];
        sumcolumn += input[k][j];
      }
      if (sumcolumn > sumrow) {
        count++;
      }
    }
  }
  printf("%d\n", count);
  return 0;
}
