#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a, b, i, j, k, r = 0, c = 0, s = 0;
  int x[31][31];
  cin >> n;
  for (i = 0; i < n; ++i) {
    for (j = 0; j < n; ++j) {
      cin >> x[i][j];
    }
  }
  for (i = 0; i < n; ++i) {
    for (j = 0; j < n; ++j) {
      r = 0;
      c = 0;
      for (k = 0; k < n; ++k) {
        r += x[i][k];
        c += x[k][j];
      }
      if (c > r) s++;
    }
  }
  cout << s;
  return 0;
}
