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

    static class ProblemBImagePreview {
        int n;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            n = in.readInt();
            int a = in.readInt();
            int b = in.readInt();
            int t = in.readInt();
            String s = in.readLine();
            s += s;
            int[] cnt = new int[2 * n + 5];
            cnt[0] = s.charAt(0) == 'w' ? 1 : 0;
            for (int i = 1; i < s.length(); i++) {
                cnt[i] = cnt[i - 1] + (s.charAt(i) == 'w' ? 1 : 0);
            }
            int lo = 0, hi = n;
            while (lo < hi) {
                int mid = (lo + hi + 1) / 2;
                if (isPossible(cnt, a, b, t, mid)) {
                    lo = mid;
                } else hi = mid - 1;
            }
            out.print(lo);
        }

        boolean isPossible(int[] cnt, int a, int b, int t, int v) {
            for (int i = n - v + 1, j = 0; j < v - 1; i++, j++) {
                long wSum = cnt[i + v - 1] - cnt[i - 1];
                long sum = b * wSum + v;
                long left = v + i - 1 - n;
                long right = n - i;

                sum += Math.min((left * 2 + right) * a, (right * 2 + left) * a);
                if (sum <= t) return true;

            }
            return false;

        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.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 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);

        }

    }
}

