Under construction

Still being built. Things may change

Puju

Interview

Time limit1sMemory limit1024 MB

Summary
Given a row of N cells with thickets, find the largest plot Kazimir can reach after clearing thickets on a walk from S that uses at most K steps.
Level

Medium5 of 10

Topics
Two pointers, Prefix sum, Greedy
Solved
No attempts yet

Statement

Aednik Kazimir recently bought a new plot of land made of NN cells in a row. The cells are numbered 11 to NN from left to right. Unfortunately, some cells are overgrown with puju thickets, so they are not suitable for gardening. To clear them, Kazimir rented a weeding tractor.

At the start, Kazimir is on cell SS with the tractor. In each step he can move from his current cell to one of its neighbors, cell i−1i - 1 or cell i+1i + 1. If the new cell has thickets, the tractor uproots them and the cell becomes suitable for gardening. The tractor has fuel for only KK steps.

After the weeding, Kazimir can move without limit between cells free of thickets and plant anywhere he likes, but he cannot pass through cells with thickets. Find the maximum area where Kazimir can grow plants.

Input

The first line contains the plot size NN (1≤N≤1061 \le N \le 10^6), the tractor fuel KK (0≤K≤1090 \le K \le 10^9), and Kazimir's starting cell SS (1≤S≤N1 \le S \le N).

The second line contains exactly NN characters. '.' marks a cell without thickets and '#' marks a cell with thickets. Cell SS is suitable for gardening.

Output

Print the maximum number of cells where Kazimir can start growing plants.

Examples5

  1. Example 1

    Input
    10 1 1
    .#........
    
    Expected output
    10
    
  2. Example 2

    Input
    10 1 3
    .#.#......
    
    Expected output
    8
    
  3. Example 3

    Input
    10 2 3
    .#.#......
    
    Expected output
    8
    
  4. Example 4

    Input
    10 3 3
    .#.#......
    
    Expected output
    10
    
  5. Example 5

    Input
    10 5 1
    .#########
    
    Expected output
    6