import java.util.*;

public class Main {
	static int n, a, b, t;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		a = sc.nextInt();
		b = sc.nextInt();
		t = sc.nextInt();
		char[] ori;
		int sumfw[] = new int[n];
		int sumbk[] = new int[n];
		ori = sc.next().toCharArray();

		sumfw[0] = sumbk[0] = cal(ori[0]);
		for (int i = 1; i < n; i++) {
			sumfw[i] = sumfw[i - 1] + cal(ori[i]) + a;
			sumbk[i] = sumbk[i - 1] + cal(ori[n - i]) + a;
		}
		int time = 0;
		int count = 0;

		int fwCount = 0;
		for (int i = 0; i < n; i++) {
			fwCount = i + 1;
			if (sumfw[i] > t) {
				fwCount--;
				break;
			}
		}
		int bkCount = 0;
		for (int i = 0; i < n; i++) {
			bkCount = i + 1;
			if (sumbk[i] > t) {
				bkCount--;
				break;
			}
		}
		if (fwCount < bkCount) {
			int tmp[] = sumfw;
			sumfw = sumbk;
			sumbk = tmp;
			int t = fwCount;
			fwCount = bkCount;
			bkCount = t;
		}
		if (fwCount == n) {
			System.out.println(n);
		} else {
			int start = 0;
			int end = fwCount;
			int current = fwCount;
			while (end - 1 > start) {
				int mid = (start + end) / 2;
				int remain = t - (sumfw[mid] + a * mid);
				int visit = 0;
				for (int i = 0; i < n; i++) {
					visit = i + 1;
					if (sumbk[i] > remain) {
						visit--;
						break;
					}
				}
				if ((mid + visit) > current) {
					end = (start + mid) / 2;
					current = mid + visit;
				} else {
					start = (end + mid) / 2;
				}
			}
			System.out.println(Math.min(current, n));
		}

	}

	static int cal(char ch) {
		return ch == 'h' ? 1 : b + 1;
	}

}
