import java.io.*;
import java.util.*;

public class Div2_345_D2 {
	public static void main(String[] args) throws IOException {
		BufferedInputStream bis = new BufferedInputStream(System.in);
		BufferedReader br = new BufferedReader(new InputStreamReader(bis));
		PrintWriter out = new PrintWriter(System.out);
		String line;
		StringTokenizer st;
		while ((line = br.readLine()) != null && !line.equals("")) {
			st = new StringTokenizer(line);
			int n = Integer.parseInt(st.nextToken());
			int swap = Integer.parseInt(st.nextToken());
			int flip = Integer.parseInt(st.nextToken());
			int T = Integer.parseInt(st.nextToken());
			String status = br.readLine().trim();
			long [] watch = new long[n+1];
			for(int j = 0;j < n;j++) {
				watch[j] = 1+(status.charAt(j)=='w'?flip:0);
			}
			int res = 0;
			for(int direction = 0;direction < 2;direction++) {
				long [] sum = new long[n+1];
				for(int j = 1;j <= n;j++) 
					sum[j] = sum[j-1]+watch[j]+swap;
				watch[n] = watch[0];
				long elapsed = 0;
				int watched = 0;
				for(int i = n;i >= 1;i--) {
					elapsed += watch[i];
					if(elapsed > T)
						break;
					watched++;
					res = Math.max(res, watched);
					int remaining = (int)Math.max(T-elapsed-(n-i)*1l*swap, 0);
					int start = 0, end = i-1, mid;
					while(start < end) {
						mid = (start+end+1)/2;
						if(sum[mid] <= remaining)
							start = mid;
						else
							end = mid-1;
					}
					if(sum[start] <= remaining)
						res = Math.max(res, watched+start);
					elapsed += swap;
				}
				for(int i = 1;i < n-i;i++) {
					long t = watch[i];
					watch[i] = watch[n-i];
					watch[n-i] = t;
				}
			}
			res = Math.min(res, n);
			out.println(res);
		}
		out.close();
	}
}