# Saddle points

Very easy

Execution time limit is 2 seconds

Runtime memory usage limit is 128 megabytes

The matrix $A$ is given. It contains $n$ rows and $m$ columns. The saddle point of the matrix is an element that is minimum in its row and maximum in its column.

Find the number of saddle points in a given matrix.

## Input

The first line contains two integers $n$ and $m(1≤n,m≤750)$. Then given $n$ rows with $m$ numbers in each. The $j$-th number of the $i$-th line equals $A_{ij}$. All $A_{ij}$ do not exceed $1000$ by absolute value.

## Output

Print the number of saddle points.

## Examples

Input #1

Answer #1

Input #2

Answer #2

Submissions 5K

Acceptance rate 39%