import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStreamReader;
import java.io.IOException;

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

    static class TaskD {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int N = in.nextInt();
            int a = in.nextInt();
            int b = in.nextInt();
            long T = in.nextInt();
            String s = in.next();
            int[] flag = new int[N];
            for (int i = 0; i < N; i++) {
                flag[i] = s.charAt(i) == 'w' ? 1 : 0;
            }
            int[] toRight = new int[N];
            int[] toLeft = new int[N];
            toRight[0] = b * flag[0] + 1;
            toLeft[0] = toRight[0];
            if (toRight[0] > T) {
                out.println(0);
                return;
            }
            int ans = 1;
            int rightEnd = 0;
            int leftEnd = 0;
            for (int i = 1; i < N; i++) {
                toRight[i] = toRight[i - 1] + a + b * flag[i] + 1;
                if (toRight[i] > T) {
                    rightEnd = i;
                    break;
                }
                ans = Math.max(ans, i + 1);
            }
            if (rightEnd == 0) {
                out.println(N);
                return;
            }
            for (int i = N - 1; i >= 1; i--) {
                toLeft[i] = toLeft[(i + 1) % N] + a + b * flag[i] + 1;
                if (toLeft[i] > T) {
                    leftEnd = i;
                    break;
                }
                ans = Math.max(ans, N - i + 1);
            }
            for (int left = N - 1; left > leftEnd; left--) {
                while (true) {
                    int right = left + ans;
                    if (right <= N) break;
                    right -= N;
                    if (right >= rightEnd) break;
                    long time = toRight[right] + toLeft[left] - toRight[0] + Math.min(right, N - left) * (long) a;
                    if (time <= T) {
                        ans++;
                    } else {
                        break;
                    }
                }
            }
            for (int right = 1; right < rightEnd; right++) {
                while (true) {
                    int left = right - ans;
                    if (left >= 0) break;
                    left += N;
                    if (left <= leftEnd) break;
                    long time = toRight[right] + toLeft[left] - toRight[0] + Math.min(right, N - left) * (long) a;
                    if (time <= T) {
                        ans++;
                    } else {
                        break;
                    }
                }
            }
            out.println(ans);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

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

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

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

    }
}

