Problem P: 【GESP4】二阶矩阵

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:6 Solved:4

Description

 小A 有一个 n行m 列的矩阵A 。
 小A 认为一个 2 x 2 的矩阵 是好的,当且仅当 D11 x D22 = D12 x D21 。其中Dij 表示矩阵 D 的第 i 行 第 j 列的元素。
 小A 想知道 A 中有多少个好的矩阵。

       样例中的好的矩阵如下:



Input

第一行,两个正整数 n,m 。
接下来n行 ,每行 m 个整数 Ai,1 , Ai,2 , ....... , Ai,m  。

Output

输出一个整数,表示 A 中好的子矩阵的数量。

Sample Input Copy

3 4
1 2 1 0
2 4 2 1
0 3 3 0

Sample Output Copy

2

HINT