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
 *
 * @author shu_mj @ http://shu-mj.com
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        Scanner in;
        PrintWriter out;

        public void solve(int testNumber, Scanner in, PrintWriter out) {
            this.in = in;
            this.out = out;
            run();
        }

        void run() {
            int n = in.nextInt();
            int a = in.nextInt();
            int b = in.nextInt();
            int t = in.nextInt();
            String s = in.next();
            if (n == 1) {
                int res = 0;
                if (s.charAt(0) == 'h' || b + 1 <= t) res = 1;
                out.println(res);
                return;
            }
            String r = s.charAt(0) + "" + (new StringBuilder(s.substring(1)).reverse().toString());
            out.println(Math.max(go(n, a, b, t, s), go(n, a, b, t, r)));
        }

        private int go(int n, int a, int b, int t, String s) {
            int[] left = new int[n];
            int res = 0;
            for (int i = 0; i < n; i++) {
                int crt = (i == 0 ? 0 : a) + 1;
                if (s.charAt(i) == 'w') crt += b;
                left[i] = crt + (i == 0 ? 0 : left[i - 1]);
                if (left[i] <= t) res = i + 1;
            }
            for (int i = 0; i < n; i++) {
                left[i] += i * a;
            }
            int[] rev = new int[n];
            for (int i = n - 1; i >= 0; i--) {
                int crt = a + 1;
                if (s.charAt(i) == 'w') crt += b;
                rev[i] = (i == n - 1 ? 0 : rev[i + 1]) + crt;
            }
            if (left[0] + rev[n - 1] > t) return res;
            int i = 0, j = n - 1;
            while (j > i && left[i] + rev[j] <= t) j--;
//        Algo.debug(i, j);
//        Algo.debug(left);
//        Algo.debug(rev);
            if (i == j) return n;
            while (i < n) {
                while (j < n && left[i] + rev[j] > t) j++;
                if (j == n) return res;
                res = Math.max(res, (i + 1) + (n - j));
//            Algo.debug(i, j, (i + 1) + (n - j));
                i++;
            }
            return res;
        }

    }

    static class Scanner {
        BufferedReader br;
        StringTokenizer st;

        public Scanner(InputStream in) {
            br = new BufferedReader(new InputStreamReader(in));
            eat("");
        }

        private void eat(String s) {
            st = new StringTokenizer(s);
        }

        public String nextLine() {
            try {
                return br.readLine();
            } catch (IOException e) {
                return null;
            }
        }

        public boolean hasNext() {
            while (!st.hasMoreTokens()) {
                String s = nextLine();
                if (s == null)
                    return false;
                eat(s);
            }
            return true;
        }

        public String next() {
            hasNext();
            return st.nextToken();
        }

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

    }
}

