#include <bits/stdc++.h>
using namespace std;
int n, ret, r, c;
int a[33][33];
int main() {
  cin >> 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++) {
      r = 0;
      c = 0;
      for (int k = 0; k < n; k++) r += a[k][j];
      for (int k = 0; k < n; k++) c += a[i][k];
      if (r > c) ret++;
    }
  cout << ret;
  return 0;
}
