#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(A) A.begin(),A.end()
#define bp '\n'
#define vp cout<<'\n';
const int N=2e5+5;
signed main(){
cin.tie(nullptr)->sync_with_stdio(false);
int n,m,q,l,r;
cin>>n>>m>>q;
vector<string>a(n);
int vst[n][m];
memset(vst,0,sizeof(vst));
vector<pair<int,int>>land;
for(int i=0;i<n;++i){
cin>>a[i];
for(int j=0;j<m;++j){
if(a[i][j]=='#'){
land.emplace_back(i,j);
vst[i][j]=1;
}
}
}
string k;
cin>>k;
for(int ps=k.size()-1;ps>=0;--ps){
char e=k[ps];
int o=0,p=0;
if(e=='N'){
--o;
}else if(e=='S'){
++o;
}else if(e=='W'){
--p;
}else if(e=='E'){
++p;
}
for(auto&[f,s]:land){
int i=o+f,j=p+s;
vst[i][j]=1;
}
}
int cnt=0;
for(auto&c:vst){
for(auto&e:c){
cnt+=e==0;
}
}
cout<<cnt;
}
/*
3
print
the
poem
*/