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