import java.util.*;

public class Solution
{
       static int calc(int n , int a , int b , int T , StringBuffer s)
       {
              int max = 0;
              TreeMap<Integer,Integer> map = new TreeMap<Integer,Integer>();
              int cost = 0;
              for(int i = n-1 ; i >= 0 ; i--)
              {
                     cost += a;
                     if(s.charAt(i) == 'h')
                     cost += 1;
                     
                     else
                     cost += 1+b;
                     
                     map.put(cost,i);
              }
              
              cost = 0;
              for(int i = 0 ; i < n ; i++)
              {
                     if(i != 0)
                     cost += a;
                     
                     if(s.charAt(i) == 'h')
                     cost += 1;
                     
                     else
                     cost += 1+b;
                     
                     if(cost <= T)
                     {
                            max = Math.max(max , i+1);
                            if(cost+(i)*a <= T)
                     if(map.lowerKey(T-(cost+(i)*a)+1) != null)
                     {
                            max = Math.max(max , Math.min(n , i+1+n-map.get(map.lowerKey(T-(cost+(i)*a)+1))));
                           
                     }
                     
                     
                     }
              }
              return max;
       }
       public static void main(String []args)
       {
              Scanner sc = new Scanner(System.in);
              int n = sc.nextInt();
              int a = sc.nextInt();
              int b = sc.nextInt();
              int T = sc.nextInt();
              sc.nextLine();
              String s = sc.nextLine();
              StringBuffer str = new StringBuffer(s);
              int max = calc(n,a,b,T,str);
              max = Math.max(max , calc(n,a,b,T,str.reverse()));
              System.out.println(max);
             
       }
}