All-one Matrices
题号:NC51545
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 512 M,其他语言1024 M
64bit IO Format: %lld

题目描述

Gromah and LZR entered the great tomb, the first thing they see is a matrix of size , and the elements in the matrix are all  or .

LZR finds a note board saying "An all-one matrix is defined as the matrix whose elements are all , you should determine the number of all-one submatrices of the given matrix that are not completely included by any other all-one submatrices".

Meanwhile, Gromah also finds a password lock, obviously the password should be the number mentioned in the note board!

Please help them determine the password and enter the next level.

输入描述:

The first line contains two positive integers , denoting the size of given matrix.

Following lines each contains a string with length , whose elements are all or , denoting the given matrix.


输出描述:

Print a non-negative integer, denoting the answer.
示例1

输入

复制
3 4
0111
1110
0101

输出

复制
5

说明

The 5 matrices are (1,2)-(1,4), \; (1,2)-(2,3), \; (1,2)-(3,2), \; (2,1)-(2,3), \; (3,4)-(3,4)_{}.