Only 1 and 2 test case pass

import java.util.*;
public class Main {
public static void main(String args[]) {
// Your Code Here

	Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int m=sc.nextInt();
    int k=sc.nextInt();
    int s=sc.nextInt();
    char a[][]=new char[n][m];
	for(int i=0;i<n;i++)
	{
	for(int j=0;j<m;j++)
	a[i][j]=sc.next().charAt(0);
	} 
	for(int i=0;i<n;i++)
	{
 for(int j=0;j<m;j++)
	{
	char q=a[i][j];
	if(q=='.')
	{
	if(j<m-1)
	s=s-3;
	else 
	s=s-2;
	}
 else if(q=='*')
 {
if(j<m-1) 
s=s+4;
else s=s+5; }
 else
  break;
	} }
if(s>k) {
 System.out.println("Yes");
  System.out.println(s); }
else 
System.out.println("No"); 
}

}