Ten

아직 제출이 없습니다시간 제한0.5초메모리 제한1024 MB

문제

A real estate company IC is managing a rectangular section of land. The section is divided into mnmn segments in m×nm \times n matrix shape, where the number of rows and that of columns are mm and nn, respectively. Each segment has its own price as a positive integer. IC wants to sell a rectangular subsection of the land, but the price of the subsection should be ten. The price of a subsection is simply the sum of the prices of the segments in the subsection. Since there can be several such subsections, IC wants to identify the number of candidate subsections to sell. Write a program to help IC, counting the number of candidate subsections of the land.

For example, the prices of segments of the land having 5×75 \times 7 segments are given as follows:

We can find four candidate subsections to sell marked by rectangles: the first one consists of four segments in the first and the second rows spanning over from the second to the third columns, the second, six segments in the second and the third rows spanning over from the third to the fifth columns, the third, two segments in the first row spanning over from the fifth to the sixth columns, and the fourth, three segments in the seventh column spanning over from the third to the fifth rows. Therefore, your program should report four for the above input.

입력

Your program is to read from standard input. The input starts with two positive integers mm and nn (1m,n3001 \le m, n \le 300), denoting the dimensions of the land, which are given separated by a space. Each of the following mm lines contains nn positive integers p_ijp\_{ij} representing the prices of the segments of the ii-th row of the land (1im1 \le i \le m, 1jn1 \le j \le n, and 1p_ij101 \le p\_{ij} \le 10). The prices are also separated by a space.

출력

Your program is to write to standard output. Print exactly one line containing an integer representing the number of rectangular subsections with the price of ten.