\problemname{Window Shopping}
\illustration{0.35}{windowshopping.png}{One optimal way of installing windows for the first sample case.
The blue cells are the shops.
The red edges are the windows.}
You are to help a newly built shopping mall design its floor layout.
The shopping mall can be viewed as a rectangular grid of cells.
Two cells are adjacent if they share an edge.
A cell may be empty, a pillar, or an escalator.
There are exactly two escalators: one goes upstairs and the other downstairs.
Note that the escalators are small, so that customers to the mall can pass freely through their locations without going up or down.

You are to choose some of the empty cells to build shops.
All remaining empty cells, plus the two escalator cells, are {\it walkable} by the customers.
If an empty cell is reachable from both escalators via some walkable cells, it becomes a {\it hallway}.
A shop window can be installed on an edge between a shop and a hallway.

After the floor planning, it is allowed to have some empty cells not reachable from both escalators.
These empty cells are thus not hallways and cannot have windows installed around them.
Also, an escalator is not a hallway and windows cannot be installed on any side of an escalator.

Based on the latest customer analysis report, the profit of the shopping mall grows proportionally to the number of windows inside the mall.
You need to therefore determine the maximum number of shop windows that can be installed in the shopping mall.

\section*{Input}
The first line of input contains two positive integers $r$ and $c$ ($4 \leq r \cdot c \leq 99$), which are the size of the shopping mall. The mall is a grid with $r$ rows and $c$ columns of cells.

Each of the next $r$ lines contains a string of length $c$.
Each character in the string is one of:
\vspace{-0.5cm}
\begin{description}
    \setlength{\itemsep}{0pt}
    \setlength{\parskip}{0pt}
    \setlength{\parsep}{0pt}
\item a dot `{\tt .}' representing an empty cell
\item a hash `{\tt \#}' representing a pillar
\item a letter `{\tt U}' representing an Up escalator (Exactly one of these will appear)
\item a letter `{\tt D}' representing a Down escalator (Exactly one of these will appear)
\end{description}
\vspace{-.45cm}
It is guaranteed that initially all empty cells are reachable from both escalators.

\section*{Output}
Output a single integer, which is the maximum number of windows the shopping mall can accommodate.
