import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.security.interfaces.DSAKey;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class a {

	public static class in {
		static BufferedReader reader;
		static StringTokenizer tokenizer;

		static void init(InputStream input) {
			reader = new BufferedReader(new InputStreamReader(input));
			tokenizer = new StringTokenizer("");
		}

		static String next() throws IOException {
			while (!tokenizer.hasMoreTokens())
				tokenizer = new StringTokenizer(reader.readLine());
			return tokenizer.nextToken();
		}

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

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

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

	public static long comp(int n, int r) {
		r = Math.min(r, n - r);
		long ans = 1;
		for (int i = 1; i <= r; i++) {
			ans = ans * (long) (n - r + i) / (long) i;
		}
		return ans;

	}

	public static class node implements Comparable<node> {

		int x;
		int pos;

		node(int x, int p) {
			this.x = x;
			pos = p;
		}

		@Override
		public int compareTo(node o) {
			if (o.x < x)
				return 1;
			else if (o.x > x)
				return -1;
			return 0;
		}
	}

	public static long gcd(int x, int y) {
		if (y == 0)
			return x;
		return gcd(y, x % y);
	}

	public static int z[];

	public static void Z_algorithm(char[] a, ArrayList<Long> arr) {
		z = new int[a.length];
		z[0] = a.length;
		int l = 0, r = 0;
		for (int i = 1; i < a.length; i++) {

			if (i > r) {
				l = r = i;

				while (r < a.length && a[r - l] == a[r]
						&& (long) arr.get(r - l) == (long) arr.get(r)) {

					r++;
				}

				z[i] = r - l;
				r--;
			} else {
				int k = i - l;
				if (z[k] < r - i + 1)
					z[i] = z[k];
				else {
					l = i;
					while (r < a.length && a[r - l] == a[r]
							&& (long) arr.get(r - l) == (long) arr.get(r))
						r++;
					z[i] = r - l;
					r--;
				}
			}

		}
	}

	public static long tree[];
	public static int n;

	public static void add(int idx, long val) {

		while (idx <= n) {
			tree[idx] += val;
			idx += (idx & -idx);
		}
	}

	public static long get(int idx) {
		long g = 0;
		while (idx > 0) {
			g += tree[idx];
			idx -= (idx & -idx);
		}
		return g;
	}

	public static void main(String[] args) throws IOException {
		StringBuilder qq = new StringBuilder();
		in.init(System.in);
		PrintWriter out = new PrintWriter(System.out);
		// source code
		n = in.nextInt();
		int a = in.nextInt();
		int b = in.nextInt();
		int t = in.nextInt();
		String x = in.next();

		double dp[] = new double[n + 1];
		double dp2[] = new double[n + 2];
		if (x.charAt(0) == 'h')
			dp[1] = 1;
		else
			dp[1] = b + 1;

		for (int i = 1; i < n; i++) {
			if (x.charAt(i) == 'h')
				dp[i + 1] = (double) (dp[i] + 1L + (long) a);
			else
				dp[i + 1] = (double) (dp[i] + 1L + (long) a + (long) b);

		}

		dp2[n]++;
		if (x.charAt(n - 1) == 'w')
			dp2[n] += b;
		for (int i = n - 2; i >= 0; i--) {
			if (x.charAt(i) == 'h')
				dp2[i + 1] = (double) (dp2[i + 2] + 1L + (long) a);
			else
				dp2[i + 1] = (double) (dp2[i + 2] + 1L + (long) a + (long) b);

		}

		int lo = 0;
		int hi = n;

		while (hi - lo > 1) {
			int mid = (lo + hi) / 2;

			boolean ok = true;
			for (int i = 1; i <= mid; i++) {
				double k = dp[i] + dp2[n - (mid - i) + 1]
						+ ((n - (mid - i) + 1) <= n ? (a * (i)) : 0);

				if (k <= (long) t) {
				//	System.out.println(mid + " " + k + " " + i);
					lo = mid;
					ok = false;
					break;
				}
			}
			if (ok)
				hi = mid;

		}

		for (int i = 1; i <= hi; i++) {
			double k = dp[i] + dp2[n - (hi - i) + 1]
					+ ((n - (hi - i) + 1) <= n ? (a * (i)) : 0);
			if (k <= (long) t) {

				System.out.println(hi);
				return;
			}
		}

		out.println(lo);

		out.close();

	}
}