#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];
  int sum = 0, sump = 0;
  int k, c = 0;
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) {
      sum = 0, sump = 0;
      for (k = 0; k < n; k++) {
        sum += a[i][k];
      }
      for (k = 0; k < n; k++) {
        sump += a[k][j];
      }
      if (sum < sump) c++;
    }
  cout << c;
}
