#include
using namespace std;
int magicalParks(char a[][100],int n,int m,int k,int s){
bool success=true;
for(int i=0;i<n;i++)
{
if(s<k)
{
success=false;
// return false;
break;
}
for(int j=0;j<m;j++)
{
char ch=a[i][j];
/* if(s<k)
{
success=false;
break;
}*/
if(ch=='.')
{
s = s-2;
}
else if(ch=='*' )
{
s = s+5;
}
else {
break;
}
if(j!=n-1){
s=s-1;
}
}
}
return s;
}
int main(){
int row,col,k,s;
cin>>row>>col>>k>>s;
char park [100][100];
for(int i=0;i<row;i++){
for(int j=0;j<col;j++){
cin>>park[i][j];
}
}
int check = magicalParks(park,row,col,k,s);
if(check){
cout<<"YES"<<endl;
cout<<check<<endl;
}
else{
cout<<"NO";
}
return 0;
}