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
 *
 * @author Artem Gilmudinov
 */
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);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        int[] cntH;
        int[] cntW;
        int n;
        int a;
        int b;
        long T;

        public void solve(int testNumber, InputReader in, PrintWriter out) {

            n = in.readInt();
            a = in.readInt();
            b = in.readInt();
            T = in.readLong();
            String s = in.readLine();
            cntH = new int[n + 1];
            cntW = new int[n + 1];
            for (int i = 1; i <= n; i++) {
                cntH[i] = cntH[i - 1] + (s.charAt(i - 1) == 'h' ? 1 : 0);
                cntW[i] = cntW[i - 1] + (s.charAt(i - 1) == 'w' ? 1 : 0);
            }
            int left, right, mid;
            left = 1;
            right = n;
            while (left < right) {
                mid = left + (right - left) / 2;
                if (check(mid)) {
                    left = mid + 1;
                } else {
                    right = mid;
                }
            }
            if (!check(left)) {
                --left;
            }
            out.println(left);
        }

        public boolean check(int cnt) {
            int other, w, min;
            long res;
            for (int j = 1; j <= cnt; j++) {
                other = cnt - j;
                w = cntW[j];
                w += cntW[n] - cntW[n - other];
                min = Math.min(j - 1, other);
                res = b * w + cnt + a * 2 * min + a * (cnt - min - 1);
                if (res <= T) {
                    return true;
                }
            }
            return false;
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

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

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

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

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

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return isWhitespace(c);
        }

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

        private String readLine0() {
            StringBuilder buf = new StringBuilder();
            int c = read();
            while (c != '\n' && c != -1) {
                if (c != '\r')
                    buf.appendCodePoint(c);
                c = read();
            }
            return buf.toString();
        }

        public String readLine() {
            String s = readLine0();
            while (s.trim().length() == 0)
                s = readLine0();
            return s;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}

