The official statement of a problem is always the one
in the PDF document. The HTML version of the statement
is also given to help you, but may contain some content
that is not well displayed. In case of doubt, always use the PDF.
Public test cases
Input
HELLO_WORLD
5
HEL
O_WOKLD
WOR
HE
LL
Output
1
Input
HELLO_WORLD
5
HEL
O_WOKLD
WOR
HE
LL
Output
1
Input
WE_ARE_THE_CHAMPIONS
9
ADKE_
__
ARE
CHAM_PIO
DDKK
WEEEE
W
KLLLE
IIWW
Output
9
Input
WE_ARE_THE_CHAMPIONS
9
ADKE_
__
ARE
CHAM_PIO
DDKK
WEEEE
W
KLLLE
IIWW