#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <complex>
#include <string>
#include <algorithm>
#include <numeric>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#ifndef LOCAL
#define debug(x) ;
#else
#define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl;

template <typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &p) {
  out << "{" << p.first << ", " << p.second << "}";
  return out;
}

template <typename T>
ostream &operator<<(ostream &out, const vector<T> &v) {
  out << '{';
  for (const T &item : v) out << item << ", ";
  out << "\b\b}";
  return out;
}
#endif

#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 200010

ll power(ll k, ll n, int M){
  if(n == 0) return 1;
  if(n == 1) return k % M;

  ll res = power(k, n/2, M);

  res = res * res % M;

  if(n % 2)
    res = k % M * res % M;

  return res;
}

/* Number Theoretic Transform */

namespace NTT {
  void DFT(int m, int root, vector<int> &a, bool rev = false) {
    int N = a.size(), h = 0;

    for (int i = 0; 1 << i < N; i++) h++;
    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 = 1; i < N; i *= 2) {
      int base = power(root, (m - 1) / i / 2, m);
      if (rev) base = power(base, m - 2, m);
      ll w = 1;
      for (int j = 0; j < i; j++) {
        for (int k = 0; k < N; k += i*2) {
          int s = a[j+k], t = a[j+k+i] * w % m;
          a[j+k+0] = (s + t) % m;
          a[j+k+i] = (s - t + m) % m;
        }
        w = w * base % m;
      }
    }

    if (rev) {
      ll tmp = power(N, m-2, m);
      for(int &v : a) v = v * tmp % m;
    }
  }

  //(1012924417, 5), (924844033, 5)

  vector<int> conv(int _mod, int root, const vector<int> &a, const vector<int> &b) {
    int s = 1, t = a.size() + b.size() - 1;
    while(s < t) s *= 2;

    vector<int> F(s), G(s);
    for(int i = 0; i < (int)a.size(); i++) F[i] = a[i];
    for(int i = 0; i < (int)b.size(); i++) G[i] = b[i];
    DFT(_mod, root, F); DFT(_mod, root, G);

    for(int i = 0; i < s; i++) F[i] = (ll)F[i] * G[i] % _mod;
    DFT(_mod, root, F, true);

    return F;
  }
};


int N, M, K, L;
char B[500][501], S[SIZE];
int counter[500][500];

int main(){

  scanf("%d%d%d%d", &N, &M, &K, &L);

  for(int i=0; i<N; i++) {
    scanf("%s", B[i]);
  }

  scanf("%s", S);

  int x = 0, y = 0;

  for(int i=0; i<L; i++) {
    if (S[i] == 'R') x++;
    if (S[i] == 'L') x--;
    if (S[i] == 'D') y++;
    if (S[i] == 'U') y--;

    counter[y][x]++;
  }

  vector<int> a(M * M), b(M * M);

  for(int i=0; i<M; i++)
    for(int j=0; j<M; j++)
      a[i*M + j] = counter[i][j];

  for(int i=0; i<N; i++)
    for(int j=0; j<N; j++)
      b[i*M + j] = B[i][j] == 'X';

  auto res = NTT::conv(924844033, 5, a, b);

  int ans = 0;

  for(int i=0; i<M; i++)
    for(int j=0; j<M; j++)
      ans += res[i*M + j] >= K;

  printf("%d\n", ans);

  return 0;
}



Measured memory_bytes: 9872