import java.util.Scanner;

public class ImagePreview {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int T = sc.nextInt();
		String line = sc.nextLine();
		line = sc.next();
		boolean[] isV = new boolean[n];
		for (int i=0;i<n;i++){
			if (line.charAt(i) == 'h') {
				isV[i] = true;
			}
		}
		int max = -1;
		
		//Stretegy 1: go right and don't turn around
		int i = 0;
		long time = 1;
		if (!isV[0]) {
			time = 1+b;
		}
		if (time > T) {System.out.println(0); Runtime.getRuntime().halt(0);}
		while (i<n-1) {
			long temp = time + (long) a + 1;
			if (!isV[i+1]) {
				temp = temp + (long) b;
			}
			if (temp <= T) {
				time = temp;
				i++;
			}
			else {break;}
		}
		max = i+1;
		
		//Strategy 2: go left and don't turn around
		i=0;
		time = 1;
		if (!isV[0]) {
			time = 1+b;
		}
		i=n;
		while (i-1>0) {
			long temp = time + (long) a + 1;
			if (!isV[i-1]) {
				temp = temp + (long) b;
			}
			if (temp <= T) {
				time = temp;
				i--;
			}
			else {break;}
		}
		if (n-i+1 > max) {
			max = i;
		}
		
		//Strategy 3: go right to i and turn back to j (j>i)
		long timeI = 1;
		if (!isV[0]) {
			timeI = 1+b;
		}
		for (i=1; i<n; i++) {
			timeI = timeI + (long) a + 1;
			if (!isV[i]) {
				timeI = timeI + (long) b;
			}
			if (timeI <= T) {
				long temp = timeI + i; //temp: going to i then back to 0
				int j=n;
				while (j-1>i) {
					long tempJ = temp + (long) a +1;
					if (!isV[j-1]) {tempJ = tempJ + (long) b;}
					if (tempJ <= T) {temp = tempJ; j--;}
					else {break;}
				}
				if (i+1 + n-j > max) {max = i+1 + n-j;}
			}
			else break;
		}
		
		//Strategy 4: go left to i and turn back to j (i>j)
		timeI = 1;
		if (!isV[0]) {
			timeI = 1+b;
		}
		for (i=n-1; i>0; i--) {
			timeI = timeI + (long) a + 1;
			if (!isV[i]) {
				timeI = timeI + (long) b;
			}
			if (timeI <= T) {
				long temp = timeI + n-i; //temp: going to i then back to 0
				int j=0;
				while (j+1<i) {
					long tempJ = temp + (long) a +1;
					if (!isV[j+1]) {tempJ = tempJ + (long) b;}
					if (tempJ <= T) {temp = tempJ; j++;}
					else {break;}
				}
				if (n-i+1 + j > max) {max = n-i+1 + j ;}
			}
			else break;
		}
		
		System.out.println(max);
	}
	
}
