\gdef\thisproblemauthor{Anton Maydell}
\gdef\thisproblemdeveloper{Anton Maydell}
\begin{problem}{Checkers}
{checkers.in}{checkers.out}
{2 seconds (\textsl{3 seconds for Java})}{256 mebibytes}{}

A checkers-playing server hosts $N$ different playing engines.
Vasya wants to play exactly $K$ games against these engines.
Vasya likes to play white very much.
So he wants to maximize the number of games in which he plays white.

Vasya plays sets of games with each engine sequentially:
first, he plays against the first engine, then against the second, and so on.
After playing agains the last one, Vasya can once again play
with the first engine.
The number of games in each set is chosen by Vasya,
but each set must consist of one or two games.

Let the \textit{color history} of a player be the following sequence
of colors: the color he played in the previous game, the color
in the pre-previous game, and so on.
In each new game, the colors are distributed by the following algorithm.
Consider the color histories of the engine and Vasya and compare them
as sequences: as long as the previous colors are the same,
look one game backwards.
If the difference is found, the two colors are ``swapped''.
If the history is too short to distribute colors by the above algorithm,
Vasya will play white.

For example, suppose that Vasya played black in the previous game
but white in the pre-previous one.
Next, suppose that an engine played black in the previous two games.
First, we compare black and black (previous games).
After that, we compare Vasya's white and engine's black (pre-previous games)
and stop as we found the difference.
The colors are then ``swapped'': it means that now Vasya will play black
and the engine will play white.

Help Vasya maximize the number of games he plays as white.

\InputFile

The first line of input contains two positive integers $N$ and $K$
not exceeding $20$.
Next $N$ lines contain the colors which the engines played
before meeting Vasya.
The colors are listed in historical order;
in particular, the last color mentioned is the color which the engine played
in its previous game.
The length of each such line is at least one
Each line consists only of characters ``\texttt{W}'' and ``\texttt{B}''.

\OutputFile

On the only line of output, print a single integer:
the maximal number of games Vasya can play as white.

\Examples

\begin{example}
\exmp{%
2 2
W
W
}{%
2
}%
\exmp{%
2 5
W
B
}{%
3
}%
\end{example}

\end{problem}
