Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|

RGB7960 - Cow Beauty Pageant

Hearing that the latest fashion trend was cows with three spots on their hides, Farmer John has purchased an entire herd of three-spot cows. Unfortunately, fashion trends tend to change quickly, and the most popular current fashion is cows with only one spot! FJ wants to make his herd more fashionable by painting each of his cows in such a way that merges their three spots into one. The hide of a cow is represented by an N by M grid of characters like this: ................ ..XXXX....XXX... ...XXXX....XX... .XXXX......XXX.. ........XXXXX... ..XXX....XXX.... Here, each 'X' denotes part of a spot. Two 'X's belong to the same spot if they are vertically or horizontally adjacent (diagonally adjacent does not count), so the figure above has exactly three spots. All of the cows in FJ's herd have exactly three spots. FJ wants to use as little paint as possible to merge the three spots into one. In the example above, he can do this by painting only four additional characters with 'X's (the new characters are marked with '*'s below to make them easier to see). ................ ..XXXX....XXX... ...XXXX*...XX... .XXXX..**..XXX.. ...*....XXXXX... ..XXX....XXX.... Please help FJ determine the minimum number of new 'X's he must paint in order to merge three spots into one large spot.

Input

Input description...

Output

Output description...

Example

Input:
etc.

Output:
etc.


Нэмсэн:Bataa
Огноо:2013-12-29
Хугацааны хязгаарлалт:1s
Эх кодын хэмжээний хязгаарлалт:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Програмчлалын хэлүүд:ADA95 ASM32 BASH BF C NCSHARP CSHARP C++ 4.3.2 CPP C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO JULIA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON PYPY3 PYTHON3 RUBY SCALA SCM guile ST TCL WHITESPACE
Эх сурвалж:USACO 2011 November Contest, Silver Division

© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.