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