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 {
        int n;
        int a;
        int b;
        int T;
        String s;
        int[] ps;

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

            ps = new int[2 * n];

            for (int i = 1; i < 2 * n; ++i) {
                if (s.charAt(i) == 'w')
                    ps[i] = ps[i - 1] + 1 + b;
                else
                    ps[i] = ps[i - 1] + 1;
            }

            int l = 1, p = n + 1;
            while (l < p) {
                int m = (l + p) / 2;

                if (f(m)) l = m + 1;
                else p = m;
            }
            out.print(l - 1);
        }

        boolean f(int m) {
            if (m == 0) return true;
            for (int i = n - (m - 1); i <= n; ++i) {
                int j = i + (m - 1);

                int s1 = ps[j] - ps[i - 1];
                int s2 = a * (m - 1) + a * Math.min(j - n, n - i);

                if (s1 + s2 <= T) return true;
            }
            return false;
        }

    }

    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());
        }

    }
}

