import java.io.*;
import java.util.*;
import java.math.BigInteger;
import java.util.Map.Entry;

import static java.lang.Math.*;

public class B extends PrintWriter {

	int solve(int n, long[] v, long a, long b, long t) {
		long[] sum = new long[n];
		sum[0] = 0;
		for (int i = 1; i < n; i++) {
			sum[i] = a + sum[i - 1] + v[i];
		}

		int ans = 0;
		long time = 0;

		for (int i = 0; i < n; i++) {
			int j = (n - i) % n;
			time += v[j];
			if (t < time) {
				break;
			}

			int cnt = i + 1;
			long ret = a * i;

			long rem = t - time - ret;

			if (rem > 0) {
				int k = Arrays.binarySearch(sum, rem);
				if (k < 0) {
					k = (~k) - 1;
				}

				if (j != 0 && k >= j) {
					k = j - 1;
				}

				cnt += k;
			}
			ans = max(ans, cnt);
			time += a;
		}

		return ans;
	}

	void run() {
		int n = nextInt();
		long a = nextInt(), b = nextInt(), t = nextInt();
		long[] v = new long[n];
		long[] u = new long[n];
		Arrays.fill(v, 1L);
		Arrays.fill(u, 1L);

		String ort = next();
		for (int i = 0; i < n; i++) {
			if (ort.charAt(i) == 'w') {
				v[i] += b;
				u[(n - i) % n] += b;
			}
		}

		println(max(solve(n, v, a, b, t), solve(n, u, a, b, t)));
	}

	void skip() {
		while (hasNext()) {
			next();
		}
	}

	int[][] nextMatrix(int n, int m) {
		int[][] matrix = new int[n][m];
		for (int i = 0; i < n; i++)
			for (int j = 0; j < m; j++)
				matrix[i][j] = nextInt();
		return matrix;
	}

	String next() {
		while (!tokenizer.hasMoreTokens())
			tokenizer = new StringTokenizer(nextLine());
		return tokenizer.nextToken();
	}

	boolean hasNext() {
		while (!tokenizer.hasMoreTokens()) {
			String line = nextLine();
			if (line == null) {
				return false;
			}
			tokenizer = new StringTokenizer(line);
		}
		return true;
	}

	int[] nextArray(int n) {
		int[] array = new int[n];
		for (int i = 0; i < n; i++) {
			array[i] = nextInt();
		}
		return array;
	}

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

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

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

	String nextLine() {
		try {
			return reader.readLine();
		} catch (IOException err) {
			return null;
		}
	}

	public B(OutputStream outputStream) {
		super(outputStream);
	}

	static BufferedReader reader;
	static StringTokenizer tokenizer = new StringTokenizer("");
	static Random rnd = new Random();
	static boolean OJ;

	public static void main(String[] args) throws IOException {
		OJ = System.getProperty("ONLINE_JUDGE") != null;
		B solution = new B(System.out);
		if (OJ) {
			reader = new BufferedReader(new InputStreamReader(System.in));
			solution.run();
		} else {
			reader = new BufferedReader(new FileReader(new File(B.class.getName() + ".txt")));
			long timeout = System.currentTimeMillis();
			while (solution.hasNext()) {
				solution.run();
				solution.println();
				solution.println("----------------------------------");
			}
			solution.println("time: " + (System.currentTimeMillis() - timeout));
		}
		solution.close();
		reader.close();
	}
}