import java.util.*;
public class FAT {
	static Scanner in = new Scanner(System.in);
	public static void main(String[] args) {
		int n = in.nextInt();
		int a = in.nextInt();
		int b = in.nextInt();
		int t = in.nextInt();
		int[] time = new int[n];
		in.nextLine();
		String s = in.nextLine();
		for (int i = 0; i < n; i++) time[i] = s.charAt(i) == 'h' ? 1:b;
		int[] tfor = new int[n];
		for (int i = 1; i < n; i++) tfor[i] = tfor[i-1] + time[i] + a;
		int[] tbak = new int[n];
		for (int i = 1; i < n; i++) tbak[i] = tbak[i-1] + time[n-i] + a;
		t -= time[0];
		if (t < 0) {
			System.out.println(0);
			return;
		}
		int ans = 1;
		for (int i = 0; i < n-2; i++) {
			int ser = t-tfor[i]-i*a;
			if (ser > 0) ans = Math.max(ans, Math.abs(Arrays.binarySearch(tbak, ser)+1)+i);
			ser = t-tbak[i]-i*a;
			if (ser > 0) ans = Math.max(ans, Math.abs(Arrays.binarySearch(tfor, ser)+1)+i);
		}
		System.out.println(Math.min(ans, n));
	}
}