import java.util.*;
import java.io.*;
public class Solution
{
       static int calc(int n , int a , int b , int T , char[] s,int turn)
       {
              int max = 0;
              TreeMap<Integer,Integer> map = new TreeMap<Integer,Integer>();
              Integer cost = 0;
              for(int i = n-1 ; i >= 0 ; i--)
              {
                     cost += a;
                     if(turn == 1 && i == n-1)
                     {
                            map.put(cost,i);
                            continue;
                     }
                     
                     else
                     {
                     if(s[i] == 'h')
                     cost += 1;
                     
                     else
                     cost += 1+b;
                     
                     map.put(cost,i);
                     }
              }
              
              cost = 0;
              if(turn == 1)
              cost = a;
              for(int i = 0 ; i < n ; i++)
              {
                     if(i != 0)
                     cost += a;
                     
                     if(s[i] == 'h')
                     cost += 1;
                     
                     else
                     cost += 1+b;
                     
                     if(cost <= T)
                     {
                            max = Math.max(max , i+1);
                            if(cost+(i)*a <= T)
                            {
                                   int sear = T-(cost+i*a)+1;
                     if(map.lowerKey(sear) != null)
                     {
                            max = Math.max(max , Math.min(n , i+1+n-map.get((int)map.lowerKey(sear))));
                           
                     }
                            }
                     
                     
                     }
                     
              }
              return max;
       }
       public static void main(String []args) throws IOException
       {
              BufferedReader br = new BufferedReader( 
                              new InputStreamReader(System.in)); 
  
        StringTokenizer st = new StringTokenizer(br.readLine());
              int n = Integer.parseInt(st.nextToken());
              int a = Integer.parseInt(st.nextToken());
              int b = Integer.parseInt(st.nextToken());
              int T = Integer.parseInt(st.nextToken());
       
              String s = br.readLine();
              char str[] = s.toCharArray();
              int max = calc(n,a,b,T,str,0);
              
              if(s.charAt(0) == 'h')
              T -= 1;
              
              else
              T -= 1+b;
              int start = 0 , end = n-1;
              while (start < end)
    {
        char temp = str[start]; 
        str[start] = str[end];
        str[end] = temp;
        start++;
        end--;
    } 
              max = Math.max(max , calc(n,a,b,T,str , 1));
              System.out.println(max);
             
       }
}