#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

using Real = double;
//using Complex = complex<Real>;

struct Complex{
    Real x, y;
    Complex():x(0),y(0){};
    Complex(Real x, Real y):x(x),y(y){};
};

inline Complex conj(Complex a){
    return Complex(a.x, -a.y);
}
inline Complex operator+(Complex a, Complex b){
    return Complex(a.x+b.x, a.y+b.y);
}
inline Complex operator-(Complex a, Complex b){
    return Complex(a.x-b.x, a.y-b.y);
}
inline Complex operator*(Complex a, Complex b){
    return Complex(a.x*b.x-a.y*b.y, a.x*b.y+a.y*b.x);
}
inline Complex operator/(Complex a, Complex b){
    Complex tmp = a*conj(b);
    return Complex(tmp.x/(b.x*b.x+b.y*b.y), tmp.y/(b.x*b.x+b.y*b.y));
}

using Type = Complex;
using Matrix = vector<vector<Type> >;

const Real PI = acos(-1);

// W[i][j] = exp(root(-1)*2*PI*j/(2^i))
vector<vector<Complex>> W;

void init(int n){
    int h = 0;
    for(int i=0;1<<i<n;i++) h++;
    W.resize(h);
    for(int i=0;1<<i<n;i++){
        int d = 1<<i;
        W[i].resize(d*2+1);
        for(int j=0;j<=d*2;j++){
            if((j&1) || i==0){
                Real theta = 2*PI/(d*2)*j;
                W[i][j] = Complex(cos(theta), sin(theta));
            }
            else{
                W[i][j] = W[i-1][j>>1];
            }
        }
    }
}

vector<Complex> FFT(vector<Complex> a, bool rev = false){
    int n = a.size();
    int h = 0;
    for(int i=0;1<<i<n;i++) h++;
    // bitを逆転させ対応する位置とswap
    for(int i=0;i<n;i++){
        int j = 0;
        for(int k=0;k<h;k++){
            j |= (i>>k&1) << (h-1-k);
        }
        if(i<j) swap(a[i], a[j]);
    }
    
    for(int i=0;1<<i<n;i++){
        int d = 1<<i;
        for(int k=0;k<n;k+=d*2){
            for(int j=0;j<d;j++){
                Complex s = a[j+k+0];
                Complex t = a[j+k+d]*W[i][rev?j:d*2-j];
                a[j+k+0] = s+t;
                a[j+k+d] = s-t;
            }
        }
    }
    if(rev) for(int i=0;i<n;i++) a[i] = a[i]/Complex(n,0);
    return a;
}

vector<Complex> convolute(vector<Complex> &a, vector<Complex> &b){
    int deg = int(a.size() + b.size()) - 1;
    int n = 1;
    while(n < deg) n <<= 1;
    a.resize(n); b.resize(n);
    init(n);

    vector<Complex> inversed_a = FFT(a);
    vector<Complex> inversed_b = FFT(b);
    vector<Complex> inversed_c(n);

    for(int i=0;i<n;i++){
        inversed_c[i] = inversed_a[i] * inversed_b[i];
    }
    vector<Complex> c = FFT(inversed_c, true);
    return c;
}

Matrix convolute(Matrix &a, Matrix &b){
    int rows = int(a.size() + b.size()) - 1, cols = int(a[0].size() + b[0].size()) - 1;
    int n = 1, m = 1;
    while(n < rows) n <<= 1;
    while(m < cols) m <<= 1;
    // n*m matrix
    a.resize(n);
    for(int i=0;i<n;i++) a[i].resize(m);
    b.resize(n);
    for(int i=0;i<n;i++) b[i].resize(m);
    init(max(n,m));

    Matrix inv_a, inv_b;
    for(int i=0;i<n;i++){
        inv_a.emplace_back(FFT(a[i]));
        inv_b.emplace_back(FFT(b[i]));
    }
    vector<Complex> acol(n), bcol(n);
    for(int j=0;j<m;j++){
        for(int i=0;i<n;i++){
            acol[i] = inv_a[i][j];
            bcol[i] = inv_b[i][j];
        }
        auto inv_acol = FFT(acol);
        auto inv_bcol = FFT(bcol);
        for(int i=0;i<n;i++){
            inv_a[i][j] = inv_acol[i];
            inv_b[i][j] = inv_bcol[i];
        }
    }
    Matrix inv_c(n, vector<Type>(m)), c;
    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
            inv_c[i][j] = inv_a[i][j] * inv_b[i][j];
        }
    }
    for(int i=0;i<n;i++){
        c.emplace_back(FFT(inv_c[i], true));
    }
    vector<Complex> inv_ccol(n);
    for(int j=0;j<m;j++){
        for(int i=0;i<n;i++){
            inv_ccol[i] = c[i][j];
        }
        auto ccol = FFT(inv_ccol, true);
        for(int i=0;i<n;i++){
            c[i][j] = ccol[i];
        }
    }
    return c;
}



int main(){
    int N, M, K, L;
    cin >> N >> M >> K >> L;
    vector<string> bomb(N);
    string s;
    for(int i=0;i<N;i++){
        cin >> bomb[i];
    }
    cin >> s;
    Matrix a(M-N+1, vector<Type>(M-N+1)), b(N, vector<Type>(N));
    for(int i=0;i<N;i++){
        for(int j=0;j<N;j++){
            if(bomb[i][j] == 'X'){
                b[i][j] = Complex(1,0);
            }
        }
    }
    int x=0, y=0;
    for(int i=0;i<L;i++){
        if(s[i] == 'U') y--;
        if(s[i] == 'D') y++;
        if(s[i] == 'L') x--;
        if(s[i] == 'R') x++;
        a[y][x].x += 1;
    }
    auto c = convolute(a,b);
    int cnt = 0;
    for(int i=0;i<M;i++){
        for(int j=0;j<M;j++){
            if(int(c[i][j].x+.1) >= K){
                cnt++;
            }
        }
    }
    cout << cnt << endl;
    return 0;
}



Measured memory_bytes: 31440