#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int arr[40][40];
  cin >> n;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) cin >> arr[i][j];
  int ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      int sr = 0, sc = 0;
      for (int k = 0; k < n; k++) {
        sr += arr[i][k];
      }
      for (int k = 0; k < n; k++) {
        sc += arr[k][j];
      }
      if (sc > sr) ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
