#include <bits/stdc++.h>
using namespace std;
int main() {
  long a[100][100] = {0}, i, j, n, s1, s2, s = 0, k;
  cin >> n;
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) cin >> a[i][j];
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) {
      s1 = s2 = 0;
      for (k = 0; k < n; k++) {
        s1 += a[i][k];
        s2 += a[k][j];
      }
      if (s2 > s1) ++s;
    }
  cout << s;
  return 0;
}
