Fabric#11803

Fabric

1 second
256 megabytes
Very hard

Nastia has a wonderful piece of fabric. The piece consists of identical square patches of size by , sewn together to form a rectangle of size by . Unfortunately, some patches have holes in them.

Nastia wants to cut out a certain rectangle from this fabric and discard the rest. The new piece of fabric must have an area of at least and must not contain any holes, meaning it consists of at least patches, none of which have holes.

Due to the laws of Uzhlandia, she can only cut the fabric along the grid lines (i.e., only at the seams of the patches, without cutting through them). Find out in how many ways it is possible to cut a rectangle with an area of at least that does not contain patches with holes.

Input

The first line contains three integers , , and (1 \le n, m \le 2000, 1 \le k \le n \cdot m) — the height and width of the fabric, and the minimum area of the desired rectangle.

The next lines contain numbers each, describing the fabric. In the -th row, the numbers are s_{i 1}, s_{i 2}, \dots s_{i m}.

s_{x y} equals if the patch at coordinates has a hole, and if it does not.

Output

Output a single line with one integer: the number of ways to cut a rectangle with an area of at least such that it does not contain any holes.

Examples

Example 1

Loading
Loading

Note

rectangles with an area of at least can be cut from the fabric. If we take the top left square as , the possible options are:

  • rectangles with an area of :

    • \{(1, 0), (2, 0), (3, 0)\}

    • \{(0, 1), (1, 1), (2, 1)\}

  • rectangle with an area of :

    • \{(1, 0), (2, 0), (1, 1), (2, 1)\}

Scoring

  1. (56 points): 1 \le n, m \le 2000, k = 1 and s_{xy} = 0 for all ;

  2. (72 points): 1 \le n, m \le 2000, k = 1 and s_{xy}=1 only for one patch ;

  3. (96 points): 1 \le n, m \le 50;

  4. (112 points): 1 \le n, m \le 500;

  5. (184 points): 1 \le n, m \le 2000 and k = 1;

  6. (280 points): 1 \le n, m \le 2000.