#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, line[35], column[35], var, count;
  cin >> n;
  for (i = 1; i <= n; ++i) line[i] = column[i] = 0;
  for (i = 1; i <= n; ++i)
    for (j = 1; j <= n; ++j) {
      cin >> var;
      line[i] += var;
      column[j] += var;
    }
  count = 0;
  for (i = 1; i <= n; ++i)
    for (j = 1; j <= n; ++j) {
      if (column[i] > line[j]) count++;
    }
  cout << count;
  return 0;
}
