#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<vector<int>> p(n, vector<int>(n));
  vector<vector<int>> a(n, vector<int>(n));
  for (int i = 0, ie = (int(p.size())); i < ie; ++i) {
    for (int j = 0, je = (int(p[i].size())); j < je; ++j) cin >> p[i][j];
  }
  int sum1 = 0, sum2 = 0, ans = 0;
  for (int i = 0, ie = (int(p.size())); i < ie; ++i) {
    sum1 = sum2 = 0;
    for (int j = 0, je = (int(p[i].size())); j < je; ++j) {
      sum1 = sum2 = 0;
      for (int k = 0; k < n; ++k) {
        sum1 += p[i][k];
        sum2 += p[k][j];
      }
      if (sum2 > sum1) ++ans;
    }
  }
  cout << ans;
}
