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

public class Main {
    public static void main(String[] args) throws IOException {
        FastScanner in = new FastScanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        new Main().run(in, out);
        out.close();
    }

    public static long mod = 17352642619633L;

    void run(FastScanner in, PrintWriter out) {

        int N = in.nextInt();
        int A = in.nextInt();
        int B = in.nextInt();
        int T = in.nextInt();

        boolean[] good = new boolean[N];
        char[] ca = in.next().toCharArray();
        for (int i = 0; i < N; i++) if (ca[i] == 'h') good[i] = true;


        int[] bcost = new int[N];
        Arrays.fill(bcost, -1);
        int max = 0;
        int bhi = 0;
        int currcost = -A;
        TreeMap<Integer, Integer> tm = new TreeMap<>();

        for (int i = 0; i < N; i++) {
            currcost += A;
            currcost++;
            if (!good[i]) currcost += B;
            bhi = i;

            if (currcost > T) break;
            bcost[i] = currcost;
            max = Math.max(max, i+1);
            tm.put(currcost, i+1);
        }

        int[] fcost = new int[N];
        Arrays.fill(fcost, -1);

        int flo = 0;
        currcost = 0;

        TreeMap<Integer, Integer> tm2 = new TreeMap<>();
        for (int i = N-1; i > 0; i--) {
            currcost += A;
            currcost += 1;
            if (!good[i]) currcost += B;

            if (currcost > T) break;
            fcost[i] = currcost;
            flo = i;
            tm2.put(currcost, N-i);
        }


        for (int i = flo; i < N; i++) {
            currcost = fcost[i] + (N-i)*A;
            int budget = T-currcost;
            Map.Entry<Integer, Integer> e = tm.floorEntry(budget);
            if (e != null) max = Math.max(max, (N-i)+Math.min(i, e.getValue()));
        }

        for (int i = 0; i < bhi; i++) {
            currcost = bcost[i] + (i)*A;
            int budget = T-currcost;
            Map.Entry<Integer, Integer> e = tm2.floorEntry(budget);
            if (e != null) max = Math.max(max, (i+1) + Math.min(N-(i+1), e.getValue()));
        }

        // System.out.println(Arrays.toString(bcost));
        // System.out.println(Arrays.toString(fcost));

        out.println(max);

    }

    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(InputStream in) {
            br = new BufferedReader(new InputStreamReader(in));
            st = null;
        }

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

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

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