import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
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
 */
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();

            out.println(Math.max(maxInDir(1), maxInDir(-1)));
        }

        private int maxInDir(int initDir) {
            TaskD.Result inInitDir = goDir(0, initDir, T, false);
            if (inInitDir.numPicturesSeen == n || inInitDir.numPicturesSeen == 0 || inInitDir
                    .numPicturesSeen == 1) {
                return inInitDir.numPicturesSeen;
            }

            int res = inInitDir.numPicturesSeen;
            int time = T - inInitDir.timeSpent - inInitDir.numPicturesSeen * a;
            int initDirEndPtr = initDir == 1 ? inInitDir.numPicturesSeen - 1 : n - inInitDir
                    .numPicturesSeen + 1;
            int otherEndPtr = initDir == 1 ? n - 1 : 1;
            int curr = inInitDir.numPicturesSeen;
            boolean movedInOpp = false;
            for (int i = 0; i < inInitDir.numPicturesSeen; i++) {
                TaskD.Result inOppositeDir = goDir(otherEndPtr, -1 * initDir, time, movedInOpp);
                movedInOpp = movedInOpp || inOppositeDir.numPicturesSeen > 0;
                curr += inOppositeDir.numPicturesSeen;
                res = Math.max(res, curr);
                curr--;
                time += ttv(initDirEndPtr) + 2 * a - inOppositeDir.timeSpent;
                initDirEndPtr = (initDirEndPtr + -1 * initDir + n) % n;
                otherEndPtr = inOppositeDir.nextPic;
            }

            return res;
        }

        private TaskD.Result goDir(int start, int dir, int remTime, boolean moveToNext) {
            int timeSpent = 0;
            int numPicturesSeen = 0;
            int nextPic = start;
            int transitionTime = moveToNext ? a : 0;
            while (numPicturesSeen < n) {
                if (transitionTime + ttv(nextPic) <= remTime) {
                    numPicturesSeen++;
                    timeSpent += transitionTime + ttv(nextPic);
                    remTime -= transitionTime + ttv(nextPic);
                    nextPic = (n + nextPic + dir) % n;
                } else {
                    break;
                }
                transitionTime = a;
            }

            return new TaskD.Result(timeSpent, numPicturesSeen, nextPic);
        }

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

        static class Result {
            int timeSpent;
            int numPicturesSeen;
            int nextPic;

            public Result(int timeSpent, int numPicturesSeen, int nextPic) {
                this.timeSpent = timeSpent;
                this.numPicturesSeen = numPicturesSeen;
                this.nextPic = nextPic;
            }

        }

    }

    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;
        }

    }
}

