Matrix

After reaching Cluj-Napoca, Comisia got bored again. While trying to find something interesting to do, she realised that Cluj-Napoca is a city with N parallel streets, each one consisting of M parallel avenues. She also knows that population defines a block as the intersection of a street with an avenue. She also discovered that some of the blocks are occupied with constructions (we call them 0 blocks) and some are unoccupied (we call them 1 blocks). One may freely walk through a 1 block without any restriction, but walking through a 0 block is strictly forbidden by the local private property laws.

Comisia (as you already know) very easily gets bored, so she will never visit the same block twice (except for the starting block). She defines a walk as a succession of 1 blocks, where every two consecutive blocks share a common edge. Also, a walk cannot end in a different place than where it started (this makes the walk more interesting) and its length must be at least 4 (because short walks are boring).

With these in mind, Comisia decided to find out how many 1 blocks can be the beginning of a valid walk. Because Cluj-Napoca is a big city, she asks you to write her a program which, for a given map of the city, computes the answer to her problem.

Input

The first line of the input will contain N and M. Each of the following N lines contains the description of a street: M characters (0 or 1).

Output

The first and only line of the output should contain the answer to Comisia's problem.

Constraints

1 ≤ N, M ≤ 500

Sample

InputOutputExplanation
3 4
1111
1101
1101
6There are 6 places from where Comisia may start a valid walk.
Questions?

Sponsors Gold