Little Ruins is a studious boy, but in rest time, he will play some little game.
Today he found a game of eliminate: there is $N \times M$ tiles which only contains '#' and '*', you have two patterns to eliminate tiles:
:.
and
.:
Each step you can use a pattern and eliminate tiles on the bottom two lines. After each step,the tiles above eliminated tiles will fall down.
Your goal is to eliminate all '*' tiles, please calculate the minimum steps.