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, a, b, t;
	static int[] cost;
	static int ans = 0;
	

	
	
    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(); a = fs.nextInt(); b = fs.nextInt(); t = fs.nextInt();
    		cost = new int[n];
    		char[] ch = fs.next().toCharArray();
    		
    		for(int i=0;i<n;i++) {
    			cost[i] = (ch[i]=='h')?1:(b+1);
    		}
    		
    		int[] COST = cost;
    		
    		go_right();
    		reverse(cost, 1, n);
    		COST = cost;
    		go_right();
    		reverse(cost, 1, n);
    		
    		go_left_right();
    		reverse(cost, 1, n);
    		go_left_right();
    		
    		out.println(Math.min(n, ans));
    		
    		
    		
    		
    		
    	}
    	
    		
    		
    		
    	out.close();
    		
    }
    
    
  
    
    static void go_right() {
    	int cur_ans = 0;
    	
    	long sum = 0;
    	
    	for(int i=0;i<n;i++) {
    		sum += cost[i];
    		if(sum>t) break;
    		cur_ans = Math.max(cur_ans, i+1);
    		sum += a;
    	}
    	ans = Math.max(ans, cur_ans);
    }
    
    
    
    static void go_left_right() {
    	long[] arr = new long[maxn];
    	arr[0] = 0;
    	for(int i=1;i<n;i++) {
    		arr[i] += arr[i-1] + cost[i]+a;
    	}
    	int[] COST = cost;
    	
    	long sum = 0;
    	int cnt = 0;
    	
    	for(int i=n;i>0;i--) {
    		int ind = i%n;
    		sum += cost[ind];
    		long tot = sum + (long)cnt*a;
    		if(tot>t) break;
    		int k = find(arr, t-tot);
    		ans = Math.max(ans, cnt+1+find(arr, t-tot)-1);
    		int ANS = ans;
    		cnt++; sum += a;
    	}
    }
    
    
    
    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 void reverse(int[] arr, int l, int r) {
    	for(int i=l;i<l+(r-l)/2;i++){
    		int f = i; int s = r-i+l-1;
    		int temp = arr[i]; arr[i] = arr[r-i+l-1]; arr[r-i+l-1] = temp;
    		int x = 1;
    	}
    }
    
    
    
    
    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];
    	}
    }
   	
}
