F. Tetris
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Tetris (Russian: Тетрис) is a puzzle video game created in 1985 by Alexey Pajitnov, a Soviet software engineer. It has been published by several companies on more than 65 platforms, setting a Guinness world record for the most ported game. After a significant period of publication by Nintendo, in 1996 the rights reverted to Pajitnov, who co-founded the Tetris Company with Henk Rogers to manage licensing.

The pieces on which the game of Tetris is based are called "tetrominoes". Pajitnov's original version for the Electronika 60 computer used green brackets to represent the blocks that make up tetrominoes. Versions of Tetris on the original Game Boy/Game Boy Color and on most dedicated handheld games use black-and-white or grayscale graphics, but most popular versions use a separate color for each distinct shape. Prior to the Tetris Company's standardization in the early 2000s, those colors varied widely from implementation to implementation.

All seven tetrominoes using the standard color scheme

Here Eric invented a new way to play Tetris. Players are given a $$$n\cdot m$$$ map with obstacles. Players need to fill the map with six tetrominoes below:

Six tetrominoes used in Eric's game

Note that there is a tetromino that can't be used in Eric's game.

The player can rotate a tetromino 0, 90, 180, or 270 degrees before he fills it.

In Eric's game, you can't make tetrominoes cover obstacles or go beyond the map boundaries. Given a map, you need to find the maximum number of tetrominoes you can fill.

Input

The first line contains two integers $$$n, m(1\le n,m \le 100)$$$.

For the next $$$n$$$ lines, each line contains $$$m$$$ characters. Each character is either a "0" or a "1", where "0" is an open space and "1" is an obstacle.

Output

An integer, representing the maximum number of tetrominoes you can fill.

Examples
Input
3 3
000
010
000
Output
2
Input
2 2
11
01
Output
0
Input
5 5
00100
01100
01001
10000
01100
Output
4