
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long a = sc.nextInt();
		long b = sc.nextInt();
		long T = sc.nextLong();
		String s = sc.next();
		long[] cum = new long[n];
		long[] rev = new long[n];
		for(int i=1;i<n;i++){
			cum[i] = cum[i-1] + a + 1 + (s.charAt(i)=='w'?b:0);
		}
		for(int i=n-1;i>=1;i--){
			rev[i] = rev[(i+1)%n] + a + 1 + (s.charAt(i)=='w'?b:0);
		}
		long init = 1 + (s.charAt(0)=='w'?b:0);
		if(init > T){
			 System.out.println(0);
		}
		else if(init + cum[n-1] <= T || init + rev[1] <= T){
			System.out.println(n);
		}
		else{
			int last = 2;
			int max = 1;
			for(int i=1;i<n-1;i++){
				last = last<=i?i+1:last;
				while(last < n){
					long val = init + cum[i] + (i*a) + rev[last];
					if(val <= T){
						break;
					}
					last++;
				}
				long val = init + cum[i];
				if(last==n){
					if(val <=T){
						int count = i + 1;
						max = Math.max(max, count);
					}
				}
				else{
					val += (i*a) + rev[last];
					if(val<=T){
						int count = i + 1 + n - last;
						max = Math.max(max, count);
					}
				}
			}
			last = n-2;
			for(int i=n-1;i>1;i--){
				last = last>=i?i-1:last;
				while(last > 0){
					long val = init + rev[i] + ((n - i) * a) + cum[last];
					if(val <= T){
						break;
					}
					last--;
				}
				long val = init + rev[i];
				if(last == 0){
					if(val<=T){
						int count = n - i + 1;
						max = Math.max(max, count);
					}
				}
				else{
					val += (((n - i) * a) + cum[last]);
					if(val<=T){
						int count = n - i + 1 + last;
						max = Math.max(max, count);
					}
				}
				
			}
			System.out.println(max);
		}
	}
}
