#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int arr[101][101];
  int row[101], col[101];
  for (int i = 0; i <= n - 1; i++) {
    row[i] = col[i] = 0;
  }
  int temp;
  for (int i = 0; i <= n - 1; i++) {
    for (int j = 0; j <= n - 1; j++) {
      scanf("%d", &temp);
      arr[i][j] = temp;
      row[i] += temp;
      col[j] += temp;
    }
  }
  int ans = 0;
  for (int i = 0; i <= n - 1; i++) {
    for (int j = 0; j <= n - 1; j++) {
      if (col[j] > row[i]) ans++;
    }
  }
  printf("%d\n", ans);
}
