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