#include<bits/stdc++.h>
using namespace std;
int main()
{
int n, m, x, y;
cin >> n >> m >> x >> y;
vector<vector<int>> a(n, vector<int>(m));
for (int i = 0; i < n; i++)
{
for (int j = 0; j < m; j++)
{
cin >> a[i][j];
}
}
vector<vector<bool>> visited(n, vector<bool>(m, false));
x--;
y--;
queue<pair<int, int>> q;
q.push({x, y});
visited[x][y] = true;
int area = 1;
int rowMoves[] = {-1, 1, 0, 0};
int colMoves[] = {0, 0, -1, 1};
while (!q.empty())
{
int row = q.front().first;
int col = q.front().second;
q.pop();
for (int i = 0; i < 4; i++)
{
int newRow = row + rowMoves[i];
int newCol = col + colMoves[i];
if (newRow >= 0 && newRow < n && newCol >= 0 && newCol < m)
{
if (a[newRow][newCol] <= a[row][col] && !visited[newRow][newCol])
{
q.push({newRow, newCol});
visited[newRow][newCol] = true;
area++;
}
}
}
}
cout << area << endl;
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkKewogICAgaW50IG4sIG0sIHgsIHk7CiAgICBjaW4gPj4gbiA+PiBtID4+IHggPj4geTsKCiAgICB2ZWN0b3I8dmVjdG9yPGludD4+IGEobiwgdmVjdG9yPGludD4obSkpOwogICAgZm9yIChpbnQgaSA9IDA7IGkgPCBuOyBpKyspCiAgICB7CiAgICAgICAgZm9yIChpbnQgaiA9IDA7IGogPCBtOyBqKyspCiAgICAgICAgewogICAgICAgICAgICBjaW4gPj4gYVtpXVtqXTsKICAgICAgICB9CiAgICB9CgogICAgdmVjdG9yPHZlY3Rvcjxib29sPj4gdmlzaXRlZChuLCB2ZWN0b3I8Ym9vbD4obSwgZmFsc2UpKTsKICAgIHgtLTsKICAgIHktLTsKCiAgICBxdWV1ZTxwYWlyPGludCwgaW50Pj4gcTsKICAgIHEucHVzaCh7eCwgeX0pOwogICAgdmlzaXRlZFt4XVt5XSA9IHRydWU7CgogICAgaW50IGFyZWEgPSAxOwogICAgaW50IHJvd01vdmVzW10gPSB7LTEsIDEsIDAsIDB9OwogICAgaW50IGNvbE1vdmVzW10gPSB7MCwgMCwgLTEsIDF9OwoKICAgIHdoaWxlICghcS5lbXB0eSgpKQogICAgewogICAgICAgIGludCByb3cgPSBxLmZyb250KCkuZmlyc3Q7CiAgICAgICAgaW50IGNvbCA9IHEuZnJvbnQoKS5zZWNvbmQ7CiAgICAgICAgcS5wb3AoKTsKCiAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCA0OyBpKyspCiAgICAgICAgewogICAgICAgICAgICBpbnQgbmV3Um93ID0gcm93ICsgcm93TW92ZXNbaV07CiAgICAgICAgICAgIGludCBuZXdDb2wgPSBjb2wgKyBjb2xNb3Zlc1tpXTsKCiAgICAgICAgICAgIGlmIChuZXdSb3cgPj0gMCAmJiBuZXdSb3cgPCBuICYmIG5ld0NvbCA+PSAwICYmIG5ld0NvbCA8IG0pCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIGlmIChhW25ld1Jvd11bbmV3Q29sXSA8PSBhW3Jvd11bY29sXSAmJiAhdmlzaXRlZFtuZXdSb3ddW25ld0NvbF0pCiAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgcS5wdXNoKHtuZXdSb3csIG5ld0NvbH0pOwogICAgICAgICAgICAgICAgICAgIHZpc2l0ZWRbbmV3Um93XVtuZXdDb2xdID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICBhcmVhKys7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9CgogICAgY291dCA8PCBhcmVhIDw8IGVuZGw7CiAgICByZXR1cm4gMDsKfQo=