#include <bits/stdc++.h>
const int M = 30;
int a[M][M], n, res;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      scanf("%d", &a[i][j]);
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      int vert = 0, hor = 0;
      for (int k = 0; k < n; ++k) {
        hor += a[i][k];
        vert += a[k][j];
      }
      if (hor < vert) res++;
    }
  }
  printf("%d", res);
}
