import javafx.util.Pair;

import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) throws IOException {
        Reader in = new Reader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));

        int n = in.nextInt();
        int a = in.nextInt();
        int b = in.nextInt();
        int T = in.nextInt();
        char[] os = in.next().toCharArray();
        char[] s = new char[2 * n];
        for (int i = 0; i < n; i++) {
            s[i] = s[i + n] = os[i];
        }

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

        if (s[n] == 'w') {
            cost[n] = b + 1;
        } else {
            cost[n] = 1;
        }
        for (int i = n + 1; i < 2 * n; i++) {
            int now = cost[i - 1] + a + 1;
            if (s[i] == 'w') {
                now += b;
            }
            cost[i] = now;
        }
        for (int i = n - 1; i >= 0; i--) {
            int now = cost[i + 1] + a + 1;
            if (s[i] == 'w') {
                now += b;
            }
            cost[i] = now;
        }

        int ans = 0;
        int left = n;
        int right = 2 * n - 1;
        while (left <= right && cost[right] > T) {
            right--;
        }
//        System.err.println(left + " " + right);
        if (left <= right) {
            ans = Math.max(ans, right - left + 1);
            while (right >= n) {
                int back = (right - n) * a;
                int limit = right - n + 1;
                while (left >= limit && cost[right] + back + cost[left] <= T) {
//                    System.err.println(left + " " + right);
                    ans = Math.max(ans, right - left + 1);
                    left--;
                }
                right--;
            }
        }
//        System.err.println("-----");
        left = 1;
        right = n;
        while (left <= right && cost[left] > T) {
            left++;
        }
//        System.err.println(left + " " + right);
        if (left < right) {
            ans = Math.max(ans, right - left + 1);
            while (left <= n) {
                int back = (n - left) * a;
                int limit = n + left - 1;
                while (right <= limit && cost[left] + back + cost[right] <= T) {
//                    System.err.println(left + " " + right);
                    ans = Math.max(ans, right - left + 1);
                    right++;
                }
                left++;
            }
        }

        out.println(ans);

        out.flush();
        in.close();
        out.close();
    }

    static class Reader {
        BufferedReader reader;
        StringTokenizer st;

        Reader(InputStreamReader stream) {
            reader = new BufferedReader(stream);
            st = null;
        }

        void close() throws IOException {
            reader.close();
        }

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

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

        String nextLine() throws IOException {
            return reader.readLine();
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

    }
}