#d2999. 最长的 X
最长的 X
The Longest X
Problem Description
You are given a string consisting of characters X and ..
You may perform the following operation between and times (inclusive):
- Replace a
.with anX.
What is the maximum possible number of consecutive Xs in the resulting string ?
Input Format
The first line contains a string .
The second line contains an integer .
Output Format
Output one integer, the answer.
Sample Input 1
XX...X.X.X.
2
Sample Output 1
5
Sample Input 2
XXXX
200000
Sample Output 2
4
Constraints
For all test data, and are guaranteed.