#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n, m, d, a = 1e18 + 1, b = -1, c, x = 1e18 + 1, y = -1, z, r,
                         count = 0, i, j, k, sum = 0, ans = 0, l, xx, sign = 1;
  cin >> n;
  long long int A[n][n], row, column;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      cin >> A[i][j];
    }
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      row = 0, column = 0;
      for (k = 0; k < n; k++) row = row + A[i][k];
      for (l = 0; l < n; l++) column = column + A[l][j];
      if (column > row) count++;
    }
  }
  cout << count << "\n";
}
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
int main() {
  fast();
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
