A canvas is a grid of rows by cols cells. Each cell is either open (.) or a wall (#). Clicking a paint bucket at an open cell fills every open cell reachable from it by repeatedly moving up, down, left, or right through open cells (walls block the fill; diagonal moves do not count).
Given the grid and the clicked cell (guaranteed to be open), report how many cells get filled, including the clicked cell itself.
Input format
Line 1: two integers rows and cols.
Next rows lines: a string of exactly cols characters, each . or #.
Last line: two integers r c — the 0-indexed row and column of the clicked cell. The clicked cell is guaranteed to be ..
Output format
A single integer: the number of cells filled (the size of the connected open region containing (r, c)).
Constraints
- 1 ≤ rows, cols ≤ 12
- 0 ≤ r < rows, 0 ≤ c < cols