#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  int a[t][t];
  for (int i = 0; i < t; ++i) {
    for (int j = 0; j < t; ++j) {
      cin >> a[i][j];
    }
  }
  int cnt = 0;
  for (int i = 0; i < t; ++i) {
    for (int j = 0; j < t; ++j) {
      int sum1 = 0, sum2 = 0;
      for (int k = 0; k < t; k++) sum1 += a[k][j];
      for (int k = 0; k < t; k++) sum2 += a[i][k];
      if (sum1 > sum2) cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}
