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

template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b)a=b;};
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b)a=b;};

template<typename T> void drop(T x){cout<<x<<endl;exit(0);};

template<typename T, T MOD = 1000000007>
struct Mint{
  static constexpr T mod = MOD;
  T v;
  Mint():v(0){}
  Mint(signed v):v(v){}
  Mint(long long t){v=t%MOD; if(v<0) v += MOD;}

  Mint pow(long long k){
    Mint res(1), tmp(v);
    while(k){
      if(k&1)  res *= tmp;
      tmp *= tmp;
      k>>=1;
    }
    return res;
  }

  static Mint add_identity(){return Mint(0);}
  static Mint mul_identity(){return Mint(1);}

  Mint inv(){return pow(MOD- 2);}

  Mint& operator+=(Mint a){v += a.v; if(v>=MOD) v -= MOD; return *this;}
  Mint& operator-=(Mint a){v += MOD - a.v; if(v>=MOD) v-=MOD; return *this;}
  Mint& operator*=(Mint a){v = 1LL * v * a.v%MOD; return *this;}
  Mint& operator/=(Mint a){return (*this) *= a.inv();}

  Mint operator+(Mint a)const{return Mint(v)+=a;}
  Mint operator-(Mint a)const{return Mint(v)-=a;}
  Mint operator*(Mint a)const{return Mint(v)*=a;}
  Mint operator/(Mint a)const{return Mint(v)/=a;}

  Mint operator-()const{return v?Mint(MOD-v):Mint(v);}

  bool operator==(const Mint a)const{return v == a.v;}
  bool operator!=(const Mint a)const{return v != a.v;}
  bool operator <(const Mint a)const{return v < a.v;}
};

template<typename T, T MOD> constexpr T Mint<T, MOD>:: mod;
template<typename T, T MOD>
ostream& operator<<(ostream &os, Mint<T, MOD> m){os<<m.v;return os;}

constexpr int bmds(int x){
  const int v[] = {1012924417};
  return v[x];
}

constexpr int brts(int x){
  const int v[] = {5, 5, 3, 3, 3};
  return v[x];
}

template<int X>
struct NTT{
  static constexpr int md = bmds(X);
  static constexpr int rt = brts(X);
  using M = Mint<int, md>;
  vector<vector<M> > rts, rrts;

  void ensure_base(int n){
    if((int)rts.size() >= n) return;
    rts.resize(n); rrts.resize(n);
    for(int i=1;i<n;i<<=1){
      if(!rts[i].empty()) continue;
      M w=M(rt).pow((md - 1)/(i<<1));
      M rw = w.inv();

      rts[i].resize(i); rrts[i].resize(i);
      rts[i][0]=M(1); rrts[i][0] = M(1);
      for(int k=1;k<i;k++){
        rts[i][k] = rts[i][k-1] * w;
        rrts[i][k] = rrts[i][k-1] * rw;
      }
    }
  }

  void ntt(vector<M> &as, bool f, int n = -1){
    if(n == -1) n = as.size();
    assert((n & (n - 1)) == 0);
    ensure_base(n);

    for(int i=0, j=1;j+1<n;j++){
      for(int k=n>>1;k>(i^=k); k>>=1);
      if(i > j) swap(as[i], as[j]);
    }

    for(int i=1;i<n;i<<=1){
      for(int j=0;j<n;j+=i*2){
        for(int k=0;k<i;k++){
          M z = as[i+j+k] * (f? rrts[i][k] : rts[i][k]);
          as[i+j+k] = as[j+k] -z;
          as[j+k] += z;
        }
      }
    }

    if(f){
      M tmp = M(n).inv();
      for(int i=0;i<n;i++) as[i] *= tmp;
    }
  }

  vector<M> multiply(vector<M> as, vector<M> bs){
    int need = as.size() + bs.size() - 1;
    int sz = 1;
    while(sz < need) sz <<= 1;
    as.resize(sz, M(0));
    bs.resize(sz, M(0));

    ntt(as, 0); ntt(bs, 0);
    for(int i=0;i<sz;i++) as[i] *= bs[i];
    ntt(as, 1);
    as.resize(need);
    return as;
  }
};

template<int X> constexpr int NTT<X>:: md;
template<int X> constexpr int NTT<X>:: rt;

template<typename T, typename Transformer>
struct Convolution2D{
  using Matrix = vector< vector<T> > ;
  const Transformer tran;
  Convolution2D(Transformer tran): tran(tran){}

  void transpose(Matrix &as){
    int n = as.size(), m = as[0].size();
    Matrix cs(as);
    as.assign(m, vector<T>(n));

    for(int i=0;i<n;i++){
      for(int j=0;j<m;j++)
        as[j][i] = cs[i][j];
    }
  }

  void transform(Matrix &as, bool f){
    for(int t=0;t<2;t++){
      for(auto &a:as) tran(a, f);
      transpose(as);
    }
  }

  Matrix multiply(Matrix as, Matrix bs){
    int nt = as.size() + bs.size() - 1;
    int mt = as[0].size() + bs[0].size() - 1;
    int n = 1, m = 1;
    while(n < nt) n <<= 1;
    while(m < mt) m <<= 1;
    as.resize(n), bs.resize(n);
    for(int i=0;i<n;i++){
      as[i].resize(m ,T(0));
      bs[i].resize(m ,T(0));
    }
    //cout<<n<<" "<<m<<endl;
    transform(as, 0); transform(bs, 0);
    for(int i=0;i<n;i++)
      for(int j=0;j<m;j++) as[i][j] *= bs[i][j];

    transform(as, 1);
    return as;
  }
};

signed main(){
  cin.tie(0);
  ios::sync_with_stdio(0);

  int n,m,k,l;
  cin>>n>>m>>k>>l;
  vector<string> bs(n);
  for(int i=0;i<n;i++) cin>>bs[i];

  string s;
  cin>>s;

  NTT<0> ntt;
  using M = NTT<0>::M;
  auto tran=[&](auto &as,bool f){ntt.ntt(as,f);};
  Convolution2D<M, decltype(tran)> conv(tran);

  using Matrix=Convolution2D<M, decltype(tran)>::Matrix;

  const int DEBUG = 0;

  Matrix A(n,vector<M>(n,0));
  for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
      A[i][j]=M(bs[i][j]=='X');

  Matrix B(m-n+1,vector<M>(m-n+1,0));
  int cy=0,cx=0;
  for(int i=0;i<l;i++){
    if(s[i]=='L') cx--;
    if(s[i]=='R') cx++;
    if(s[i]=='U') cy--;
    if(s[i]=='D') cy++;

    B[cy][cx]+=M(1);

    if(DEBUG) cout<<cy<<" "<<cx<<endl;
  }

  auto C=conv.multiply(A,B);

  if(DEBUG){
    cout<<endl;
    for(int i=0;i<n;i++){
      for(int j=0;j<n;j++)
        cout<<A[i][j].v<<" ";
      cout<<endl;
    }
    cout<<endl;
    for(int i=0;i<m-n+1;i++){
      for(int j=0;j<m-n+1;j++)
        cout<<B[i][j].v<<" ";
      cout<<endl;
    }
    cout<<endl;
    for(int i=0;i<m;i++){
      for(int j=0;j<m;j++)
        cout<<C[i][j].v<<" ";
      cout<<endl;
    }
    cout<<endl;
  }

  int ans=0;
  for(int i=0;i<m;i++)
    for(int j=0;j<m;j++)
      if(C[i][j].v>=k) ans++;

  cout<<ans<<endl;
  return 0;
}



Measured memory_bytes: 8564