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  
    
import java.io.*;
import java.math.*;
import java.util.*;

/**
* 
* @author Togrul Gasimov (ttogrul30@gmail.com)
*         Created on 13.09.2013
*/

public class Main {
public static void main(String[] args) /*throws FileNotFoundException*/ { 
   InputStream inputStream = System.in;
   OutputStream outputStream = System.out;
   FastScanner in = new FastScanner(inputStream);
   FastPrinter out = new FastPrinter(outputStream);
   TaskA solver = new TaskA();
   solver.solve(1, in, out);
   out.close();
}
}

class TaskA{
	
public void solve(int testNumber, FastScanner scan, FastPrinter out) /*throws FileNotFoundException*/ {
   //Scanner sscan = new Scanner(new File("input.txt"));
   //PrintStream oout = new PrintStream(new File("output.txt"));
	int n = scan.nextInt(), ans = 0;
	long[][] a = new long[100][100];
	long[] row = new long[100];
	long[] column = new long[100];
	for(int i = 0; i < n; i++){
		for(int j = 0; j < n; j++){
			a[i][j] = scan.nextLong(); 
		}
	}
	for(int i = 0; i < n; i++){
		for(int j = 0; j < n; j++){
			row[i] += a[i][j]; column[j] += a[i][j];
		}
	}
	for(int i = 0; i < n; i++){
		for(int j = 0; j < n; j++){
			if(row[i] < column[j])++ans;
		}
	}
	out.println(ans);
   //sscan.close();
   //oout.close();
}
}

class FastScanner extends BufferedReader {
public FastScanner(InputStream is) {
   super(new InputStreamReader(is));
}

public int read() {
   try{
       int ret = super.read();
       return ret;
   }catch(Exception e){
       throw new InputMismatchException();
   }
}

public String next() {
   StringBuilder sb = new StringBuilder();
   int c = read();
   while (isWhiteSpace(c)) {
       c = read();
   }
   if (c < 0) {
       return null;
   }
   while (c >= 0 && !isWhiteSpace(c)) {
       sb.appendCodePoint(c);
       c = read();
   }
   return sb.toString();
}

static boolean isWhiteSpace(int c) {
   return c >= 0 && c <= 32;
}

public int nextInt() {
   int c = read();
   while (isWhiteSpace(c)) {
       c = read();
   }
   int sgn = 1;
   if (c == '-') {
       sgn = -1;
       c = read();
   }
   int ret = 0;
   while (c >= 0 && !isWhiteSpace(c)) {
       if (c < '0' || c > '9') {
           throw new NumberFormatException("digit expected " + (char) c
                   + " found");
       }
       ret = ret * 10 + c - '0';
       c = read();
   }
   return ret * sgn;
}

public long nextLong() {
   return Long.parseLong(next());
}

public double nextDouble() {
   return Double.parseDouble(next());
}

public BigInteger nextBigInteger() {
   return new BigInteger(next());
}

public BigDecimal nextBigDecimal(){
   return new BigDecimal(next());
}

public String readLine(){
   try{
       return super.readLine();
   }catch(IOException e){
       return null;
   }
}
}

class FastPrinter extends PrintWriter {

public FastPrinter(OutputStream out) {
   super(out);
}
public FastPrinter(Writer out) {
   super(out);
}
}