import java.util.*;

public class Solution
{
       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();
              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;
              int max = 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(map.lowerKey(T-(cost)+1) != null)
                     {
                            max = Math.max(max , Math.min(n , i+1+n-map.get(map.lowerKey(T-cost+1))));
                     }
                     
                     else
                     {
                     
                     }
              }
              System.out.println(max);
       }
}