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

public class B {

	final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
	BufferedReader in;
	PrintWriter out;
	StringTokenizer tok = new StringTokenizer("");

	void solve() throws IOException {
		int t = 1;
		while (t-- > 0) {
			solveTest();
		}
	}

	void solveTest() throws IOException {
		int n = readInt();
		int a = readInt();
		int b = readInt();
		int t = readInt();
		boolean[] vertical = new boolean[3 * n];
		char[] c = readString().toCharArray();

		for (int i = 0; i < n; i++) {
			vertical[i] = c[i] == 'h';
			vertical[i + n] = c[i] == 'h';
			vertical[i + 2 * n] = c[i] == 'h';
		}

		int res = calc(n, vertical, a,b, t, n);
		for(int i = 0, j = n-1; i < j; i++,j--) {
			boolean tmp = vertical[j];
			vertical[j] = vertical[i];
			vertical[i] = tmp;
		}

		for(int i = n; i < 3 * n; i++) {
			vertical[i] = vertical[i%n];
		}

		int res2 = calc(n, vertical, a, b, t, 2*n-1);
		if(res < res2) {
			res = res2;
		}
		out.println(res);
	}

	int calc(int n, boolean[] vertical, int a, int b, int t, int start) {
		int[] pref = new int[3 * n];
		pref[0] = !vertical[0] ? 1 : 0;
		for(int i = 1; i < 3 * n; i++) {
			pref[i] = pref[i-1];
			if(!vertical[i]) pref[i]++;
		}
		int res = 0;
		int pointer = start == n ? 2 * n : (3 * n-1);
		for(int left = 0; left < n; left++) {
			int lb = start - left;
			long lt = a * left;
			lt += (pref[start] - pref[lb-1]) * b;
			lt += 1 * (left+1);
			lt += a * left;
			if(lt <= t) {
				if(res < left+1) {
					res = left+1;
				}
			}

			if(lt > t) continue;
			long d = t - lt;
			while (pointer != start) {
				long curNeed = (pointer-start) * (a + 1);
				curNeed += (pref[pointer] - pref[start]) * b;
				if(curNeed <= d) break;
				else pointer--;
			}
			int count = (left + 1) + (pointer-start);
			if(count > res) {
				res = count;
			}
		}
		if(res > n) {
			res = n;
		}
		return res;
	}

	void init() throws FileNotFoundException {
		if (ONLINE_JUDGE) {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
		} else {
			in = new BufferedReader(new FileReader("input.txt"));
			out = new PrintWriter("output.txt");
		}
	}

	String readString() throws IOException {
		while (!tok.hasMoreTokens()) {
			tok = new StringTokenizer(in.readLine());
		}
		return tok.nextToken();
	}

	int readInt() throws IOException {
		return Integer.parseInt(readString());
	}

	long readLong() throws IOException {
		return Long.parseLong(readString());
	}

	double readDouble() throws IOException {
		return Double.parseDouble(readString());
	}

	int[] readArr(int n) throws IOException {
		int[] res = new int[n];
		for (int i = 0; i < n; i++) {
			res[i] = readInt();
		}
		return res;
	}

	long[] readArrL(int n) throws IOException {
		long[] res = new long[n];
		for (int i = 0; i < n; i++) {
			res[i] = readLong();
		}
		return res;
	}

	public static void main(String[] args) {
		new B().run();
	}

	public void run() {
		try {
			long t1 = System.currentTimeMillis();
			init();
			solve();
			out.close();
			long t2 = System.currentTimeMillis();
			System.err.println("Time = " + (t2 - t1));
		} catch (Exception e) {
			e.printStackTrace(System.err);
			System.exit(-1);
		}
	}
}