import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.util.Map;
import java.io.IOException;
import java.util.HashMap;
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) throws Exception {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        MyBufferedReader in = new MyBufferedReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        private int T;
        private int n;
        private int a;
        private int b;
        private String p;

        public void solve(int testNumber, MyBufferedReader in, PrintWriter out) throws IOException {
            int[] data = in.getALineOfInts(4);
            n = data[0];
            a = data[1];
            b = data[2];
            T = data[3];

            p = in.readLine();

            int tmp = ttv(0);
            int res = T >= ttv(0) ? 1 : 0;
            if (res > 0) {
                Map<Integer, Map<Integer, Map<Integer, Map<Integer, Integer>>>> cache = new
                        HashMap<>();
                res += solve(1, n - 1, 0, T - ttv(0), cache);
            }
            out.println(res);
        }

        private int solve(int start, int end, int pos, int t, Map<Integer, Map<Integer, Map<Integer,
                Map<Integer, Integer>>>> cache) {
            if (t <= 0) {
                return 0;
            }

            if (start == end) {
                if (t >= a + ttv(start)) {
                    return 1;
                }
            }

            if (cache.containsKey(start)) {
                if (cache.get(start).containsKey(end)) {
                    if (cache.get(start).get(end).containsKey(pos)) {
                        if (cache.get(start).get(end).get(pos).containsKey(t)) {
                            return cache.get(start).get(end).get(pos).get(t);
                        }
                    }
                }
            }

            int res;
            int timeToOtherSide = a * (n - (end - start + 1));
            if ((end + 1) % n == pos) {
                res = 1 + Math.max(solve(start + 1, end, start, t - timeToOtherSide - ttv(start),
                                         cache),
                                   solve(start, end - 1, end, t - a - ttv(end), cache));
            } else {
                res = 1 + Math.max(solve(start + 1, end, start, t - a - ttv(start), cache),
                                   solve(start, end - 1, end, t - timeToOtherSide - ttv(start),
                                         cache));
            }

            if (cache.containsKey(start)) {
                if (cache.get(start).containsKey(end)) {
                    if (cache.get(start).get(end).containsKey(pos)) {
                        cache.get(start).get(end).get(pos).put(t, res);
                    } else {
                        cache.get(start).get(end).put(pos, new HashMap<>());
                        cache.get(start).get(end).get(pos).put(t, res);
                    }
                } else {
                    cache.get(start).put(end, new HashMap<>());
                    cache.get(start).get(end).put(pos, new HashMap<>());
                    cache.get(start).get(end).get(pos).put(t, res);
                }
            } else {
                cache.put(start, new HashMap<>());
                cache.get(start).put(end, new HashMap<>());
                cache.get(start).get(end).put(pos, new HashMap<>());
                cache.get(start).get(end).get(pos).put(t, res);
            }

            return res;
        }

        private int ttv(int pic) {
            return 1 + (p.charAt(pic) == 'h' ? 0 : b);
        }

    }

    static class MyBufferedReader {
        BufferedReader in;

        public MyBufferedReader(InputStream s) {
            this.in = new BufferedReader(new InputStreamReader(s));
        }

        public String readLine() throws IOException {
            return in.readLine();
        }

        public int[] getALineOfInts(int numExpected) throws IOException {
            int[] res = new int[numExpected];
            StringTokenizer st = new StringTokenizer(in.readLine());
            for (int i = 0; i < numExpected; i++)
                res[i] = Integer.parseInt(st.nextToken());
            return res;
        }

    }
}

