import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
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);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        long[] costSee;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int a = in.nextInt();
            int b = in.nextInt();
            int T = in.nextInt();
            String pos = in.next();
            costSee = new long[n];
            for (int i = 0; i < n; i++) {
                costSee[i] = 1 + (pos.charAt(i) == 'w' ? b : 0);
            }
            out.println(Math.min(n, Math.max(calc1(a, b, T, pos), calc2(a, b, T, pos))));
        }

        long calc1(int a, int b, int T, String pos) {
            long maxAns = 0;
            int l = 0;
            int r = 0;
            long tLeft = T;
            for (int i = 0; i < pos.length(); i++) {
                tLeft -= (i > 0 ? a : 0) + costSee[i];
                r = i;
                if (tLeft < 0) break;
                maxAns = Math.max(maxAns, l + r + 1);
            }
            while (tLeft - r * a < 0) {
                tLeft += (r > 0 ? a : 0) + costSee[r];
                r--;
            }
            tLeft -= r * a;
            while (r > 0) {
                long newTleft = tLeft;
                while (newTleft > 0) {
                    if (l >= pos.length()) break;
                    newTleft -= a + costSee[pos.length() - l - 1];
                    if (newTleft >= 0) {
                        tLeft = newTleft;
                        l++;
                    }
                }
                maxAns = Math.max(maxAns, l + r + 1);
                tLeft += a + costSee[r];
                r--;
            }
            return maxAns;
        }

        long calc2(int a, int b, int T, String pos) {
            long maxAns = 0;
            int l = 0;
            int r = 0;
            long tLeft = T;
            for (int i = 0; i < pos.length(); i++) {
                tLeft -= (i > 0 ? a : 0) + costSee[(pos.length() - i) % pos.length()];
                l = i;
                if (tLeft < 0) break;
                maxAns = Math.max(maxAns, l + r + 1);
            }
            while (tLeft - l * a < 0) {
                tLeft += (l > 0 ? a : 0) + costSee[(pos.length() - l) % pos.length()];
                l--;
            }
            tLeft -= l * a;
            while (l > 0) {
                long newTleft = tLeft;
                while (newTleft > 0) {
                    if (r >= pos.length() - 1) break;
                    newTleft -= a + costSee[r + 1];
                    if (newTleft >= 0) {
                        tLeft = newTleft;
                        r++;
                    }
                }
                maxAns = Math.max(maxAns, l + r + 1);
                tLeft += a + costSee[pos.length() - l];
                l--;
            }
            return maxAns;
        }

    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer stt;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
        }

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

        public String next() {
            while (stt == null || !stt.hasMoreTokens()) {
                stt = new StringTokenizer(nextLine());
            }
            return stt.nextToken();
        }

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

    }
}

