#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[30][30], b[30][30], c[30][30];
  while (cin >> n) {
    int i, j;
    for (i = 0; i < n; i++) {
      for (j = 0; j < n; j++) {
        cin >> a[i][j];
      }
    }
    for (i = 0; i < n; i++) {
      int sum = 0;
      for (j = 0; j < n; j++) sum = sum + a[i][j];
      for (j = 0; j < n; j++) b[i][j] = sum;
    }
    for (i = 0; i < n; i++) {
      int sum = 0;
      for (j = 0; j < n; j++) sum = sum + a[j][i];
      for (j = 0; j < n; j++) c[j][i] = sum;
    }
    int sum = 0;
    for (i = 0; i < n; i++) {
      for (j = 0; j < n; j++) {
        if (c[i][j] > b[i][j]) sum++;
      }
    }
    cout << sum << endl;
  }
  return 0;
}
