Five-star challenge
In the initially empty rectangle is allowed to put five stars in a row vertically or horizontally, without exceeding the boundaries of the rectangle. In this case, five different stars have the right to cross and overlap each other.
You are given the location of stars in the rectangle. Can I get it on these rules, and if so, what minimum number of fives stars should be put to get it?
Input
The first line of the input file contains two integers m and n - the height and width of the rectangle (1 ≤ m ≤ 5; 1 ≤ n ≤ 10).
In each of the next m lines contain n characters of "*" and "." corresponding to the asterisk and an empty cage.
Output
Derive -1 if this configuration can not be obtained. Otherwise, output the smallest number of fives stars, with which you can get this configuration.