#include <bits/stdc++.h>
using namespace std;
const int MX = 30 + 1;
int check(int arr[][32], int l, int m, int n) {
  int cols = 0, rows = 0;
  for (int j = 0; j < n; j++) {
    rows += arr[l][j];
  }
  for (int i = 0; i < n; i++) {
    cols += arr[i][m];
  }
  if (cols > rows) {
    return true;
  }
  return false;
}
int main() {
  int n;
  cin >> n;
  int arr[MX + 1][MX + 1];
  for (int u = 0; u < n; u++) {
    for (int v = 0; v < n; v++) {
      cin >> arr[u][v];
    }
  }
  int cnt = 0;
  for (int u = 0; u < n; u++) {
    for (int v = 0; v < n; v++) {
      if (check(arr, u, v, n)) {
        cnt++;
      }
    }
  }
  cout << cnt << "\n";
  return 0;
}
