#include <bits/stdc++.h>
using namespace std;
const long double PI = 3.141592653589793238L;
int main() {
  long long q[31][31];
  int n;
  int d;
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> d;
      q[i][j] = d;
    }
  }
  int c, k;
  int p = 0;
  for (int o = 0; o < n; o++) {
    for (int i = 0; i < n; i++) {
      c = k = 0;
      for (int j = 0; j < n; j++) {
        c += q[i][j];
      }
      for (int e = 0; e < n; e++) {
        k += q[e][o];
      }
      if (k > c) {
        p++;
      }
    }
  }
  cout << p << endl;
  return 0;
}
