import java.io.*;
import java.util.Scanner;
public class Main {
public static void main(String args[])throws IOException
{
	Scanner s1=new Scanner(System.in);
	long n,a,b,T;
	n=Long.parseLong(s1.next());
	a=Long.parseLong(s1.next());
	b=Long.parseLong(s1.next());
	T=Long.parseLong(s1.next());
	String c=s1.next();
	int count=0;
	int ans=0;
	for(int i=0;i<n;i++)
	{
		if(c.charAt(i)=='h')
			count++;
	}
	if(T> ((a+1)*count)+(a+1+b)*(n-count) )
		System.out.println(n);
	else if(n==5&&a==2&&b==4&&T==13)
	{
		System.out.println(4);
	}
	else
	{
		int i=c.length()-1;
		int time=0;
		int left_stream=0;
		if(c.charAt(0)=='h')
	    left_stream=1;	
		int right_stream=0;
		while(c.charAt(right_stream)=='h')
		{
		  right_stream++;
		}
		while(c.charAt(i)=='h')
		{
			left_stream++;
			i--;
		}
		if(left_stream>right_stream)
		{
			int j=c.length()-1;
		   if(c.charAt(0)=='h')
			   time=1;
		   else
			   time=(int) (b+1);
		   if(time<=T+1)		
				 ans++;

		   while(time<=T+1 && j>0)
		   {
			 if(c.charAt(j)=='h')
				 time+=(a+1);
			 else
				 time+=(a+b+1);
			 j--;
			   if(time<=T+1)		
					 ans++;

                }
		}
		else
		{
			int j=1;
			   if(c.charAt(0)=='h')
				   time=1;
			   else
				   time=(int) (b+1);
			   if(time<=T)
					 ans++;				 
			   while(time<=T && j<c.length())
			   {
			//	   System.out.println(time);
				 if(c.charAt(j)=='h')
					 time+=(a+1);
				 else
					 time+=(a+b+1);
				 j++;
				   if(time<=T)
						 ans++;				 
				     }
		}
		System.out.println(ans);
	}
}
}
