#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, cnt = 0, mat[40][40];
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> mat[i][j];
    }
  }
  int sumi = 0, sumj = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      sumi = 0;
      sumj = 0;
      for (int x = 0; x < n; x++) {
        sumi += mat[i][x];
        sumj += mat[x][j];
      }
      if (sumj > sumi) cnt++;
    }
  }
  cout << cnt;
  return 0;
}
