#include <bits/stdc++.h>
using namespace std;
int n, cnt;
int a[33][33];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      int s = 0, u = 0;
      for (int k = 0; k < n; k++) {
        s += a[i][k];
        u += a[k][j];
      }
      if (u > s) cnt++;
    }
  }
  cout << cnt << " ";
  return 0;
}
