1063_B. Labyrinth
You are playing some computer game. One of its levels puts you in a maze consisting of n lines, each of which contains m cells. Each cell either is free or is occupied by an obstacle. The starting cell is in the row r and column c. In one step you can move one square up, left, down or right, if the target cell is not occupied by an obstacle. You can't move beyond the boundaries of the labyrinth.

Unfortunately, your keyboard is about to break, so you can move left no more than x times and move right no more than y times. There are no restrictions on the number of moves up and down since the keys used to move up and down are in perfect condition.

Now you would like to determine for each cell whether there exists a sequence of moves that will put you from the starting cell to this particular one. How many cells of the board have this property?

Input

The first line contains two integers n, m (1 ≤ n, m ≤ 2000) — the number of rows and the number columns in the labyrinth respectively.

The second line contains two integers r, c (1 ≤ r ≤ n, 1 ≤ c ≤ m) — index of the row and index of the column that define the starting cell.

The third line contains two integers x, y (0 ≤ x, y ≤ 109) — the maximum allowed number of movements to the left and to the right respectively.

The next n lines describe the labyrinth. Each of them has length of m and consists only of symbols '.' and '*'. The j-th character of the i-th line corresponds to the cell of labyrinth at row i and column j. Symbol '.' denotes the free cell, while symbol '*' denotes the cell with an obstacle.

It is guaranteed, that the starting cell contains no obstacles.

Output

Print exactly one integer — the number of cells in the labyrinth, which are reachable from starting cell, including the starting cell itself.

Examples

Input

4 5
3 2
1 2
.....
.***.
...**
*....


Output

10


Input

4 4
2 2
0 1
....
..*.
....
....


Output

7

Note

Cells, reachable in the corresponding example, are marked with '+'.

First example: 
    
    
      
    +++..  
    +***.  
    +++**  
    *+++.  
    

Second example: 
    
    
      
    .++.  
    .+*.  
    .++.  
    .++.  
    
```python
from collections import deque

def move(tx, ty, s, left=False):
    if 0 <= tx < n and 0 <= ty < m:
        if smap[tx][ty] == '.' and mp[tx][ty] == -1:
            mp[tx][ty] = s
            if left:
                q.appendleft((tx, ty))
            else:
                q.append((tx, ty))

[n, m] = map(int, input().split())
[sx, sy] = map(int, input().split())
[ll, rr] = map(int, input().split())
smap = [input() for i in range(n)]

q = deque()
mp = [[-1]*m for i in range(n)]

sx, sy = sx-1, sy-1
mp[sx][sy] = 0
ans = 0

q.append((sx, sy))
while q:
    px, py = q.popleft()
    s = mp[px][py]
    ans += s + py - sy <= rr * 2 and s - py + sy <= ll * 2

    move(px + 1, py, s, left=True)
    move(px - 1, py, s, left=True)
    move(px, py - 1, s + 1)
    move(px, py + 1, s + 1)

print(ans)
```