#include <bits/stdc++.h>
using namespace std;
int main() {
  size_t n, i, j, k;
  int temp = 0, row = 0, col = 0, win = 0;
  cin >> n;
  vector<vector<int> > board(n);
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      cin >> temp;
      board[i].push_back(temp);
    }
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      row = 0;
      col = 0;
      for (k = 0; k < n; k++) {
        row += board[i][k];
        col += board[k][j];
      }
      if (col > row) win++;
    }
  }
  cout << win << endl;
  return 0;
}
