#include <bits/stdc++.h>
using namespace std;
int main() {
  int grid[40][40], n, rsums[40][40], csums[40][40], rsum, csum;
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> grid[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    rsum = csum = 0;
    for (int j = 0; j < n; j++) {
      rsum += grid[i][j];
      csum += grid[j][i];
    }
    for (int j = 0; j < n; j++) {
      rsums[i][j] = rsum;
      csums[j][i] = csum;
    }
  }
  int counter = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (rsums[i][j] < csums[i][j]) counter++;
    }
  }
  cout << counter << endl;
  return 0;
}
