include <bits/stdc++.h>
using namespace std;
int main()
{
char arr[100][100];
int row; int column ;int k; int s;
cin >> row >>column >> k >> s;
for (int i = 0; i <row ; i++) {
for (int j = 0; j <column ; j++) {
cin >> arr[i][j];
}
}
bool success=true;
for (int i = 0; i <row ; i++) {
for (int j = 0; j <column ; j++)
{
{
if(s>=k)
{
if (arr[i][j] == '.') {
s -= 2;
}
else if(arr[i][j] == '*') {
s += 5;
}
else if (arr[i][j] == '#')
{
break;
}
if(j!=column-1)
{
s--;
}
}
else
{
success=false;
}
}
}
}
if(success)
{
cout << "YES"<< endl << s;
}
else
{
cout << "NO";
}
}