#d2999. 最长的 X

最长的 X

The Longest X

Problem Description

You are given a string SS consisting of characters X and ..

You may perform the following operation between 00 and KK times (inclusive):

  • Replace a . with an X.

What is the maximum possible number of consecutive Xs in the resulting string SS?

Input Format

The first line contains a string SS.

The second line contains an integer KK.

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, 1≤∣S∣≤2×1051 \leq |S| \leq 2 \times 10^5 and 0≤K≤2×1050 \le K \le 2 \times 10^5 are guaranteed.