#include <bits/stdc++.h>
const int MX = 33;
using namespace std;
int ro[MX];
int co[MX];
int main() {
  int n, x, ans = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> x;
      ro[i] += x;
      co[j] += x;
    }
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      if (ro[j] < co[i]) ans++;
    }
  cout << ans;
}
