#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
template <class T>
T RoundOff(T a) {
  return int(a + .5 - (a < 0));
}
template <class T, class C>
void chmax(T& a, C b) {
  if (a < b) a = b;
}
template <class T, class C>
void chmin(T& a, C b) {
  if (b < a) a = b;
}
template <class T, class C>
pair<T, C> mp(T a, C b) {
  return make_pair(a, b);
}
int count(vector<vector<int> > table, int x) {
  int res = 0;
  for (int i = 0; i < table.size(); i++) {
    res += table[i][x];
  }
  return res;
}
int main() {
  int n;
  cin >> n;
  vector<vector<int> > table(n, vector<int>(n));
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) cin >> table[i][j];
  int res = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      res += accumulate(table[i].begin(), table[i].end(), 0) < count(table, j);
    }
  cout << res << endl;
}
