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