Sherlock Holmes and Dr. Watson played some game on a checkered board n × n in size. During the game they put numbers on the board's squares by some tricky rules we don't know. However, the game is now over and each square of the board contains exactly one number. To understand who has won, they need to count the number of winning squares. To determine if the particular square is winning you should do the following. Calculate the sum of all numbers on the squares that share this column (including the given square) and separately calculate the sum of all numbers on the squares that share this row (including the given square). A square is considered winning if the sum of the column numbers is strictly greater than the sum of the row numbers.

<image>

For instance, lets game was ended like is shown in the picture. Then the purple cell is winning, because the sum of its column numbers equals 8 + 3 + 6 + 7 = 24, sum of its row numbers equals 9 + 5 + 3 + 2 = 19, and 24 > 19.

Input

The first line contains an integer n (1 ≤ n ≤ 30). Each of the following n lines contain n space-separated integers. The j-th number on the i-th line represents the number on the square that belongs to the j-th column and the i-th row on the board. All number on the board are integers from 1 to 100.

Output

Print the single number — the number of the winning squares.

Examples

Input

1
1


Output

0


Input

2
1 2
3 4


Output

2


Input

4
5 7 8 4
9 5 3 2
1 6 6 4
9 5 7 3


Output

6

Note

In the first example two upper squares are winning.

In the third example three left squares in the both middle rows are winning:
    
    
    5 7 8 4  
    9 5 3 2  
    1 6 6 4  
    9 5 7 3  
    
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std ;
using namespace __gnu_pbds;

#define  int  long long
#define  mod 1000000007
#define  mod2 998244353
#define  inf INT32_MAX 
#define  Inf 1e18
#define  Endl "\n"
#define  pb push_back
#define  ff first
#define  ss second
#define  pd(ar,n)  for ( int i = 0 ; i < n ; i++ ) { cerr << ar[i] << " " ; } cerr << Endl ;
#define  pdd(ar,n,m) for ( int i = 0 ; i < n ; i++ ) { { for ( int j = 0 ; j < m ; j++ ) { cerr << ar[i][j] << " " ; } ; cerr << Endl ; } } cerr << Endl ;
#define  sz(s) (int)((s).size())
#define  setb __builtin_popcountll
#define  all(x) (x).begin(),(x).end()
#define  Ceil(x,y) ((int)ceil((1.0*x)/y)) 
#define  Floor(x,y) ((int)floor(x/y)  
#define  clr(a,x) memset(a,x,sizeof a) ;
#define  pbds tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define  FAST_IO ios_base :: sync_with_stdio (0) ; cin.tie(0) ; cout.tie(0) ; 
/* pbds functions 
find_by_order(k) - finds index of k in pbds 
order_of_key(k) - number of elements strictly less than k
*/

typedef pair <int,int> pii ;
typedef vector <int> vi ;
typedef vector <vector<int>> vvi ;
typedef vector <pair<int,int>> vpi;
typedef map <int,int> mii ;

#define  N 

/*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

#ifndef ONLINE_JUDGE 
	#define deb(x) cerr << #x << " = " ; print(x) ; cerr << endl ;
	#define deb2(x,y) cerr << #x << ":" << x << "  " << #y << ":" << y << endl ;
	#define deb3(x,y,z) cerr << #x << ":" << x << "  " << #y << ":" << y << "  " << #z << ":" << z << endl ;
	#define deb4(w,x,y,z) cerr << #w << ":" << w << "  " << #x << ":" << x << "  " << #y << ":" << y << "  " << #z << ":" << z << endl ;
	#define deb5(u,w,x,y,z) cerr << #u << ":" << u << "  " << #w << ":" << w << "  " << #x << ":" << x << "  " << #y << ":" << y << "  " << #z << ":" << z << endl ;
#else
	#define deb(x) 
#endif

template <class T> void print ( T t ) { cerr << t ; }
template <class T1, class T2> void print ( pair <T1,T2> p ) { cerr << "{ " ; print(p.first) ; cerr <<", " ; print(p.second) ; cerr << " }" ; } ;
template <class T> void print ( vector <T> v ) { cerr <<  "[ " ; for (T i : v) { print(i) ; cerr << " " ;} cerr << "]" ; } ;
template <class T> void print ( set <T> s ) { cerr << "{ " ; for ( T i : s ) { print(i) ; cerr << " " ; } cerr  << "]" ; } ;
template <class T> void print ( multiset <T> ms ) { cerr << "{ " ; for ( T i : ms ) { print(i) ; cerr << " " ; } cerr  << "]" ; } ;
template <class T1, class T2> void print ( map <T1,T2> m ) { cerr << "[ " ; for ( auto i : m ) { print(i) ; cerr << " " ; } cerr << "]" ; }
template <class T> void print ( T a[] , int n ) { cerr << "a =" << " " ; cerr << "{ " ; for ( int i = 0 ; i < n ; i++ ) { cerr << a[i] ; cerr << " " ; }  cerr << "}" ; } 

template <class T1, class T2> static inline void amin ( T1 &x , T2 y ) { if ( y < x ) x=y ; }
template <class T1, class T2> static inline void amax ( T1 &x , T2 y ) { if ( x < y ) x=y ; }

struct eet { int x = 0 , y = 0 , gcd = 0 ; } ;
void Time_Required () { cerr << "Executed in : " << 1000 * clock() / CLOCKS_PER_SEC << " ms" ; }
void Case () { static int test = 1 ; cout << "Case #" << test++ << ": " ; }
int gcd ( int a , int b ) { return b == 0 ? a : gcd ( b , a % b ) ; }
int lcm ( int a , int b ) { return (a*b)/gcd(a,b) ; }
int expo ( int a , int b , int m = 1e18 ) { int ans = 1 ; while ( b ) { if ( b & 1 ) { ans = ( ( ( ans % m ) * ( a % m ) ) % m ) ; } a = ( ( ( a % m ) * ( a % m ) ) % m ) ; b >>= 1 ; } return ans ; }
eet ext ( int a , int b ) { if ( b == 0 ) { eet t ; t.x = 1 ; t.y = 0 ; t.gcd = a ; return t ; } eet t = ext ( b , a % b ) ; eet ans ; ans.x = t.y ; ans.y = t.x - (a/b)*t.y ; ans.gcd = t.gcd ; return ans ; }
int mod_inv1 ( int a , int b = mod ) { eet ans = ext ( a , b ) ; return ( ans.x % b + b ) % b ; }
int mod_inv2 ( int a , int b = mod ) { return expo ( a , b-2 , b ) ; }
int mod_add ( int a , int b , int m = mod ) { return ( ( ( a % m ) + ( b % m ) ) + m ) % m ; }
int mod_sub ( int a , int b , int m = mod ) { return ( ( ( a % m ) - ( b % m ) ) + m ) % m ; }
int mod_mul ( int a , int b , int m = mod ) { return ( ( ( a % m ) * ( b % m ) ) + m ) % m ; }
int mod_div ( int a , int b , int m = mod ) { a = a % m ; b = b % m ; return ( mod_mul ( a , mod_inv1 ( b , m ) , m ) + m ) % m ; }
vector <int> sieve ( int n ) { int *prime_bool = new int [ n + 1 ] () ; prime_bool[0] = prime_bool[1] = 1 ; vector <int> prime ; for ( int i = 2 ; i <= n ; i++ ) { if ( prime_bool[i] == 0 ) { prime.push_back(i) ; for ( int j = i*i ; j <= n ; j += i ) { prime_bool[j] = 1 ; } } } return prime ; }

void IOE() { 
	#ifndef ONLINE_JUDGE 
		freopen("Input.txt","r",stdin) ;
		freopen("Output.txt","w",stdout) ;
		freopen("Error.txt","w",stderr) ;
	#endif
}

/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

void Go() {
	int n = 0 ;
	cin >> n ;

	vvi m(n,vi(n,0)) ;

	for ( int i = 0 ; i < n ; i++ ) {
		for ( int j = 0 ; j < n ; j++ ) {
			cin >> m[i][j] ;
		}
	}

	int ans = 0 ;

	for ( int i = 0 ; i < n ; i++ ) {
		for ( int j = 0 ; j < n ; j++ ) {
			int col = 0 , row = 0 ;
			for ( int k = 0 ; k < n ; k++ ) {
				row += m[k][j] ;
				col += m[i][k] ;
			}
			ans += col > row ;
		}
	}

	cout << ans << Endl ;
}

int32_t main () {
	
    FAST_IO 
    // IOE() ;

    int t = 1 ; 
    // cin >> t ;

    while ( t-- ) {
		// Case() ;
        Go() ;
    }

	Time_Required() ;
    return 0 ;
} 

 