Problem2139--ABC197B Visibility

2139: ABC197B Visibility

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description

Problem Statement

We have a grid of H horizontal rows and W vertical columns, where some of the squares contain obstacles.
Let (i,j) denote the square at the i-th row from the top and j-th column from the left.
You are given H strings S1,S2,S3,,SH. The j-th character of Si describes the square (i,j); # means the square contains an obstacle, and . means it does not.
We say a square is visible from another when it is on the same row or the same column, and there is no obstacle between them (including themselves).
Print the number of squares visible from the square (X,Y) (including (X,Y) itself).

Constraints

  • 1H100
  • 1W100
  • 1XH
  • 1YW
  • Si is a string of length W consisting of . and #.
  • The square (X,Y) does not contain an obstacle.

Input

Input is given from Standard Input in the following format:

H W X Y
S1
S2
S3
SH

Output

Print the answer.



Sample Input Copy

4 4 2 2
##..
...#
#.#.
.#.#

Sample Output Copy

4

Source/Category