#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, counter = 0;
  cin >> n;
  int arr[n][n];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) cin >> arr[i][j];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      int sumc = 0, sumr = 0;
      for (int k = 0; k < n; k++) {
        sumr += arr[i][k];
        sumc += arr[k][j];
      }
      if (sumc > sumr) counter++;
    }
  cout << counter;
  return 0;
}
