import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Objects;
import java.util.Random;
import java.util.StringTokenizer;

public class Solution{
	
	static final int maxn = (int)5e5+10;
	static int n;
	

	
	
    public static void main(String[] args) throws IOException {
     
    	FastScanner fs = new FastScanner();
    	PrintWriter out = new PrintWriter(System.out);
    	
    	
    		
    	int tt = 1;
    	while(tt-->0) {
    		
    		n = fs.nextInt();
    		int a = fs.nextInt(), b = fs.nextInt();
    		long t = fs.nextLong();
    		
    		
    		long[] suf = new long[maxn];
    		
    		char[] ch = fs.next().toCharArray();
    		
    		
    		for(int i=1;i<n;i++) {
    			suf[i] = suf[i-1] + ((ch[n-i]=='h')?(a+1):(a+b+1));
    		}
    		
    		int ans = 0;
    		long sum = (ch[0]=='h')?1:(b+1);
    		if(t<sum) {
    			out.println(0);
    			out.flush();
    			return;
    		}
    		
    		ans = Math.min(1 + (find(suf, t-sum)-1), n);
    		
    		for(int i=1;i<n;i++) {
    			sum += (ch[i]=='h')?(a+1):(a+b+1);
    			if(t<sum) break;
    			ans = Math.max(ans, i+1 + (find(suf, t-sum)-1));
    		}
    		
    		out.println(Math.min(ans, n));
    		
    		
    		
    		
    		
    		
    		
    	}
    	
    		
    		
    		
    	out.close();
    		
    }
    
    
   
   static int find(long[] arr, long x) {
	   int l = 1;
	   int r = n;
	   while(l<r) {
		   int mid = (l+r)/2;
		   if(arr[mid]>x) r = mid;
		   else l = mid + 1;
	   }
	   return l;
   }
    
    
    
    
    
    
    static final Random random=new Random();
    	
    static void ruffleSort(int[] a) {
    	int n=a.length;//shuffle, then sort 
    	for (int i=0; i<n; i++) {
    		int oi=random.nextInt(n); int temp=a[oi];
    		a[oi]=a[i]; a[i]=temp;
    	}
    	Arrays.sort(a);
    }
   
  
    
    	
    	
    static class FastScanner{
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	StringTokenizer st = new StringTokenizer("");
     
    	public String next(){
    		while(!st.hasMoreElements()){
    			try{
    				st = new StringTokenizer(br.readLine());
    			} catch(IOException e){
    				e.printStackTrace();
    			}
    		}
    		return st.nextToken();
    	}
    		
    	public String nextLine() throws IOException {
    		return br.readLine();
    	}
    		
    	public int nextInt(){
    		return Integer.parseInt(next());
    	}
     
    	public int[] readArray(int n){
    		int[] a = new int[n];
    		for(int i=0;i<n;i++)
    			a[i] = nextInt();
    		return a;
    	}
    		
    	public long nextLong() {
    		return Long.parseLong(next());
    	}
    		
    	public char nextChar() {
    		return next().toCharArray()[0];
    	}
    }
   	
}
