#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, g[55][55], total1 = 0, total2 = 0, count = 0;
  cin >> n;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) cin >> g[i][j];
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) {
      total1 = 0;
      total2 = 0;
      for (int l = 1; l <= n; l++) {
        total1 += g[i][l];
        total2 += g[l][j];
      }
      if (total1 < total2) count++;
    }
  cout << count;
  return 0;
}
