import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.close();
	}

	static class TaskB {
		public void solve(int testNumber, InputReader in, PrintWriter out) {
			int n = in.nextInt();
			int a = in.nextInt();
			int b = in.nextInt();
			int T = in.nextInt();
			char[] s = in.next().toCharArray();
			int[] rt = new int[n];
			int res = 0;
			for (int i = 0, t = 0; i < n; i++) {
				if (i > 0) t += a;
				if (s[i] == 'w') t += b;
				++t;
				t = Math.min(t, T + 1);
				rt[i] = t;
				if (t <= T) res = Math.max(res, i + 1);
			}
			for (int i = 0, t = 0; i < n; i++) {
				int j = (n - i) % n;
				if (i > 0) t += a;
				if (s[j] == 'w') t += b;
				++t;
				t = Math.min(t, T + 1);
				if (t <= T) res = Math.max(res, i + 1);
			}
			int[] lt = new int[n - 1];
			for (int i = 1, t = 0; i < n; i++) {
				int j = (n - i) % n;
				if (i > 1) t += a;
				if (s[j] == 'w') t += b;
				++t;
				t = Math.min(t, T + 1);
				lt[i - 1] = t;
			}

			for (int i = n - 1, j = 0; i >= 0; i--) {
				if (rt[i] <= T) {
					while (true) {
						if (i + 1 + j + 1 > n) break;
						if ((long) rt[i] + (i + 1) * a + lt[j] > T) {
							break;
						}
						res = Math.max(res, i + 1 + j + 1);
						++j;
					}
				}
			}

			out.println(res);
		}

	}

	static class InputReader {
		final InputStream is;
		final byte[] buf = new byte[1024];
		int pos;
		int size;

		public InputReader(InputStream is) {
			this.is = is;
		}

		public int nextInt() {
			int c = read();
			while (isWhitespace(c))
				c = read();
			int sign = 1;
			if (c == '-') {
				sign = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = read();
			} while (!isWhitespace(c));
			return res * sign;
		}

		public String next() {
			int c = read();
			while (isWhitespace(c))
				c = read();
			StringBuilder sb = new StringBuilder();
			do {
				sb.append((char) c);
				c = read();
			} while (!isWhitespace(c));
			return sb.toString();
		}

		int read() {
			if (size == -1)
				throw new InputMismatchException();
			if (pos >= size) {
				pos = 0;
				try {
					size = is.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (size <= 0)
					return -1;
			}
			return buf[pos++] & 255;
		}

		static boolean isWhitespace(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

	}
}

