Description
Input an n * n matrix. If two different points A(x1, y1), B (x2, y2) satisfy x1 + x2 = n + 1, y1 + y2 = n + 1, and the number at positions A and B are the same, then we say the pair (A, B) is called a symmetric pair. Find the number of symmetric pairs. In this problem, both x and y start with 1.
Input
The first line has an integer n
Then n rows, with n integers between 0 and 100 per row
Output
An integer that represents the answer.
Examples
Input 1
5
3 3 3 4 1
2 0 0 3 1
0 3 1 4 1
3 4 3 3 1
1 0 3 3 1
Output 1
3
Examples Explanation
There are 3 pairs:
(1,2) and (5,4)
(1,3) and (5,3)
(1,5) and (5,1)
Constraint
1<=n<=500