H. The Taiko Problem (taiko)
time limit per test
1 second
memory limit per test
512 megabytes
input
standard input
output
standard output
Examples
Input
16 3 3
DDK.DDK.DDK.DDK.
Output
12
Input
16 1 3
DDK.DDK.DDK.DDK.
Output
7
Input
28 4 3
K.DDK.D.K.DDK.D.KKK.D.D.K...
Output
7