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