#include <bits/stdc++.h>
int mat[35][35];
int rowsum(int i, int j, int n) {
  int sum = 0;
  for (int r = 0; r < n; ++r) sum += mat[r][j];
  return sum;
}
int colsum(int i, int j, int n) {
  int sum = 0;
  for (int c = 0; c < n; ++c) sum += mat[i][c];
  return sum;
}
int solve(int n) {
  int ans = 0;
  int sum1, sum2;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      sum1 = rowsum(i, j, n);
      sum2 = colsum(i, j, n);
      if (sum1 > sum2) ans++;
    }
  }
  return ans;
}
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        scanf("%d", &mat[i][j]);
      }
    }
    int ans = solve(n);
    printf("%d\n", ans);
  }
  return 0;
}
