import java.util.Scanner;

public class B {
	
	static long calc(int N, long A, long B, long T, long w[]) {
		long ans = 0;
		for(int i = 1; i <= N; i++) {
			long met = N - i + 1;
			long past = met + A * (N - i) + B * (w[N] - w[i - 1]);
			if(past > T) {
				continue;
			}
			ans = Math.max(ans, met);
			long low = N;
			long high = N + i;
			long basepast = A * (N - i) + past;
			for(;high - low > 1;) {
				long m = (high + low)/2;
				long newmet = m - N;
				long allpast = newmet + newmet * A + B * (w[(int)m] - w[N]) + basepast;
				if(allpast <= T) {
					ans = Math.max(ans, met + newmet);
					low = m;
				} else {
					high = m;
				}
			}
		}
		return ans;
	}
	
	static long[] makeW(int N, String line) {
		long w[] = new long[2 * N];
		
		for(int i = 1; i < 2 * N; i++) {
			w[i] = w[i - 1] + (line.charAt(i%N) == 'w' ? 1 : 0);
		}
		return w;
	}
	
	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.nextInt();
		String line = sc.next();
		String rev = line.substring(0, 1) + (new StringBuilder(line.substring(1))).reverse().toString();
		
		System.out.println(Math.max(
				calc(N, A, B, T, makeW(N, line)),
				calc(N, A, B, T, makeW(N, rev))				
				));
	}
}
