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