Problem: Problem Statement

JAG land is a country, which is represented as an $M \times M$ grid. Its top-left cell is $(1, 1)$ and its bottom-right cell is $(M, M)$.

Suddenly, a bomber invaded JAG land and dropped bombs to the country. Its bombing pattern is always fixed and represented by an $N \times N$ grid. Each symbol in the bombing pattern is either `X` or `.`. The meaning of each symbol is as follows.

* `X`: Bomb
* `.`: Empty



Here, suppose that a bomber is in $(br, bc)$ in the land and drops a bomb. The cell $(br + i - 1, bc + j - 1)$ will be damaged if the symbol in the $i$-th row and the $j$-th column of the bombing pattern is `X` ($1 \le i, j \le N$).

Initially, the bomber reached $(1, 1)$ in JAG land. The bomber repeated to move to either of $4$-directions and then dropped a bomb just $L$ times. During this attack, the values of the coordinates of the bomber were between $1$ and $M - N + 1$, inclusive, while it dropped bombs. Finally, the bomber left the country.

The moving pattern of the bomber is described as $L$ characters. The $i$-th character corresponds to the $i$-th move and the meaning of each character is as follows.

* `U`: Up
* `D`: Down
* `L`: Left
* `R`: Right



Your task is to write a program to analyze the damage situation in JAG land. To investigate damage overview in the land, calculate the number of cells which were damaged by the bomber at least $K$ times.

* * *

Input

The input consists of a single test case in the format below.

> $N$ $M$ $K$ $L$ $B_{1}$ $\vdots$ $B_{N}$ $S$

The first line contains four integers $N$, $M$, $K$ and $L$($1 \le N < M \le 500$, $1 \le K \le L \le 2 \times 10^{5}$). The following $N$ lines represent the bombing pattern. $B_i$ is a string of length $N$. Each character of $B_i$ is either `X` or `.`. The last line denotes the moving pattern. $S$ is a string of length $L$, which consists of either `U`, `D`, `L` or `R`. It's guaranteed that the values of the coordinates of the bomber are between $1$ and $M - N + 1$, inclusive, while it drops bombs in the country.

Output

Print the number of cells which were damaged by the bomber at least $K$ times.

Examples

Input| Output
---|---


2 3 2 4
XX
X.
RDLU


|


3



7 8 3 5
.XXX.X.
X..X.X.
...XX.X
XX.XXXX
..XXXX.
X.X....
..XXXXX
DRULD


|


26






Example

Input




Output

Solution (in CPP):

Solution:
#include<iostream>
using namespace std;
#include<complex>
#include<vector>
void dft(vector<complex<double> >&A,int sign)
{
	int N=A.size()>>1;
	if(N==0)return;
	vector<complex<double> >F(N),G(N);
	for(int i=0;i<N;i++)
	{
		F[i]=A[i<<1];
		G[i]=A[i<<1|1];
	}
	dft(F,sign);
	dft(G,sign);
	complex<double>z(cos(M_PI/N),sin(M_PI/N)*sign),p=1;
	for(int i=0;i<N;i++)
	{
		A[i]=F[i]+p*G[i];
		A[i+N]=F[i]-p*G[i];
		p*=z;
	}
}
vector<long long>multiply(const vector<int>&A,const vector<int>&B)
{
	if(A.empty()||B.empty())
	{
		return(vector<long long>){};
	}
	int N=1;
	vector<long long>ret(A.size()+B.size()-1);
	while(N<ret.size())N<<=1;
	vector<complex<double> >F(N),G(N);
	for(int i=0;i<A.size();i++)F[i]=A[i];
	for(int i=0;i<B.size();i++)G[i]=B[i];
	dft(F,1);
	dft(G,1);
	for(int i=0;i<N;i++)F[i]*=G[i];
	dft(F,-1);
	for(int i=0;i<ret.size();i++)ret[i]=llround((F[i]/=N).real());
	return ret;
}
int N,M,K,L;
string B[500];
int main()
{
	cin>>N>>M>>K>>L;
	vector<int>b(M*M);
	for(int i=0;i<N;i++)
	{
		cin>>B[i];
		for(int j=0;j<N;j++)
		{
			b[i*M+j]=B[i][j]=='X';
		}
	}
	string S;cin>>S;
	vector<int>c(M*M);
	int x=0,y=0;
	for(int i=0;i<S.size();i++)
	{
		if(S[i]=='U')y--;
		else if(S[i]=='D')y++;
		else if(S[i]=='L')x--;
		else x++;
		c[y*M+x]+=1;
	}
	vector<long long>A=multiply(b,c);
	int cnt=0;
	for(int i=0;i<M*M;i++)cnt+=A[i]>=K;
	cout<<cnt<<endl;
}