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

public class B {
	FastScanner in;
	PrintWriter out;

	int n, a, b, t;
	char[] c;
	
	int cost(int i) {
		if (c[i] == 'w') {
			return 1 + b;
		}
		return 1;
	}
	
	int solveCase() {
		int cur = 1;
		int r = n;
		if (c[r] == 'w') {
			cur += b;
		}
		if (cur > t) {
			return 0;
		}
		r++;
		int l = n;
		while (r < 2 * n && cur + a + cost(r) <= t) {
			cur += a + cost(r);
			r++;
		}
		int ans = r - l;
		r = l + 1;
		cur = cost(l);
		while (l > 0 && cur + a + cost(l - 1) <= t) {
			cur += a + cost(l - 1);
			l--;
		}
		ans = Math.max(ans, r - l);
		for (; r < 2 * n;) {
			cur += 2 * a + cost(r);
			while (cur > t) {
				cur -= a + cost(l);
				l++;
			}
			if (l > n) {
				break;
			}
			r++;
			ans = Math.max(ans, r - l);
		}
		return ans;
	}
	
	void solve() {
		n = in.nextInt();
		a = in.nextInt();
		b = in.nextInt();
		t = in.nextInt();
		char[] s = in.next().toCharArray();
		c = new char[2 * n];
		for (int i = 0; i < n; i++) {
			c[i] = c[i + n] = s[i];
		}
		int ans = 0;
		ans = Math.max(solveCase(), ans);
		int i = 0, j = c.length - 1;
		while (i < j) {
			char t = c[i];
			c[i] = c[j];
			c[j] = t;
			i++;
			j--;
		}
		ans = Math.max(solveCase(), ans);
		ans = Math.min(ans, n);
		out.println(ans);
	}

	void run() {
		in = new FastScanner();
		out = new PrintWriter(System.out);

		solve();

		out.close();
	}

	class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(in.br.readLine());
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

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

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

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

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