import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
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
 *
 * @author P Marecki
 */
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 {
        int n;
        int a;
        int b;
        int T;
        int[] cost;

        int bestSwipe() {
            //run right first
            int[] leftCost = new int[n];    //bin-search how far left
            leftCost[0] = 0;
            for (int i = 1; i < n; i++) {
                leftCost[i] = leftCost[i - 1] + a + cost[n - i];
            }
            int best = 0;
            int costThatFar = 0;
            for (int farRight = 0; farRight < n; farRight++) {
                costThatFar += (farRight == 0 ? 0 : a) + cost[farRight];  //move + rotate & watch
                if (costThatFar > T) break;
                //try swipe left
                int backToZero = farRight * a;
                int fundsLeft = T - costThatFar - backToZero;
                int leftAddCount = 0;
                if (fundsLeft > 0) {
                    int ii = Arrays.binarySearch(leftCost, fundsLeft);
                    if (ii < 0) ii = (-ii) - 2;
                    leftAddCount = Math.min(ii, n - 1 - farRight);
                }
                best = Math.max(best, (farRight + 1) + leftAddCount);
            }
            return best;
        }

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

            cost = new int[n];
            String s = in.next();
            for (int i = 0; i < n; i++) {
                cost[i] = 1 + (s.charAt(i) == 'h' ? 0 : b);
            }

            int best = bestSwipe();

            int[] ncost = new int[n];
            ncost[0] = cost[0];
            for (int i = 1; i < n; i++) {
                ncost[i] = cost[n - i];
            }
            cost = ncost;
            best = Math.max(best, bestSwipe());
            out.println(best);
        }

    }

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

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            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());
        }

    }
}

