#include <bits/stdc++.h>
double E = 1e-9;
using namespace std;
int mabs(int a) {
  if (a < 0)
    return -a;
  else
    return a;
}
int main() {
  int n, res = 0;
  scanf("%d", &n);
  vector<vector<int> > g(n);
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) {
      int x;
      scanf("%d", &x);
      g[i].push_back(x);
    }
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) {
      int s1 = 0, s2 = 0;
      for (int k = 0; k < n; ++k) s1 += g[i][k];
      for (int k = 0; k < n; ++k) s2 += g[k][j];
      if (s2 > s1) res++;
    }
  cout << res << endl;
  return 0;
}
