import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Random;
import java.util.StringTokenizer;

public class Main {

	static int MOD = 1000 * 1000 * 1000 + 7;

	public static void shuffleArray(int[] arr) {
		int n = arr.length;
		Random rnd = new Random();
		for (int i = 0; i < n; ++i) {
			int tmp = arr[i];
			int randomPos = i + rnd.nextInt(n - i);
			arr[i] = arr[randomPos];
			arr[randomPos] = tmp;
		}
	}

	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		solve(in, out);
		out.close();
		System.exit(0);
	}

	static class Pair implements Comparable<Pair> {
		int x;
		int y;

		Pair(int x, int y) {
			this.x = x;
			this.y = y;
		}

		@Override
		public int compareTo(Pair o) {
			int comp = Integer.compare(x, o.x);
			int comp2 = Integer.compare(y, o.y);
			if (comp != 0) {
				return comp;
			} else {
				return comp2;
			}
		}

	}

	private static void solve3(InputReader in, PrintWriter out) {
		int a = in.nextInt();
		int b = in.nextInt();
		int[][] dp = new int[201][201];
		for (int sum = 2; sum <= 200; sum++) {
			for (int i = 1; i <= sum; i++) {
				int j = sum - i;
				if (i - 2 >= 0 && j > 1) {
					dp[i][j] = Math.max(dp[i][j], dp[i - 2][j + 1]) + 1;
				}
				if (j - 2 >= 0 && i > 1) {
					dp[i][j] = Math.max(dp[i][j], dp[i + 1][j - 2]) + 1;
				}
			}
		}

		out.print(dp[a][b]);
	}

	private static void solve2(InputReader in, PrintWriter out) {
		int n = in.nextInt();
		int[] tab = new int[1002];
		for (int i = 0; i < n; i++) {
			int curr = in.nextInt();
			tab[curr]++;
		}
		int res = 0;
		int all = 0;
		for (int i = 1000; i >= 1; i--) {
			res += Math.min(tab[i], all);
			all += tab[i];
		}

		out.print(res);
	}

	private static void solve(InputReader in, PrintWriter out) {

		int n = in.nextInt();
		long a = in.nextInt();
		long b = in.nextInt();
		long T = in.nextLong();
		char[] s = in.next().toCharArray();
		long[] right = new long[n];
		long[] left = new long[n];
		right[0] = 1 + (s[0] == 'w' ? b : 0);
		left[0] = 0;

		for (int i = 1; i < n; i++) {
			long changeCost = (s[i] == 'w' ? b : 0);
			right[i] = right[i - 1] + a + changeCost + 1;
		}
		for (int i = 1; i < n; i++) {
			int pos = n - i;
			long changeCost = (s[pos] == 'w' ? b : 0);
			left[pos] = left[(pos + 1) % n] + a + changeCost + 1;
		}

		long best = 0;
		int bestL = n - 1;
		for (int i = n - 1; i >= 0; i--) { // right
			long time = right[i];
			if (time <= T) {
				best = Math.max(best, i + 1);
				long rem = T - time;
				rem -= a * i; // back time
				while (bestL > i && rem >= left[bestL]) {
					best = Math.max(best, i + 1 + (n - bestL));
					bestL--;
				}
			}
		}

		char[] tmp = new char[s.length];
		tmp[0] = s[0];
		for (int i = 1; i < n; i++) {
			tmp[i] = s[n - i];
		}
		for (int i = 0; i < n; i++) {
			s[i] = tmp[i];
		}

		// **** left
		right = new long[n];
		left = new long[n];
		right[0] = 1 + (s[0] == 'w' ? b : 0);
		left[0] = 0;

		for (int i = 1; i < n; i++) {
			long changeCost = (s[i] == 'w' ? b : 0);
			right[i] = right[i - 1] + a + changeCost + 1;
		}
		for (int i = 1; i < n; i++) {
			int pos = n - i;
			long changeCost = (s[pos] == 'w' ? b : 0);
			left[pos] = left[(pos + 1) % n] + a + changeCost + 1;
		}

		bestL = n - 1;
		for (int i = n - 1; i >= 0; i--) { // right
			long time = right[i];
			if (time <= T) {
				best = Math.max(best, i + 1);
				long rem = T - time;
				rem -= a * i; // back time
				while (bestL > i && rem >= left[bestL]) {
					best = Math.max(best, i + 1 + (n - bestL));
					bestL--;
				}
			}
		}
		out.print(best);
	}

	/*
	 * 
	 */
	// --------------------------------------------------------
	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public String nextLine() {
			String str = "";
			try {
				str = reader.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}

			return str;
		}
	}

}