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

public class Main {
    private final InputReader in;
    private final PrintWriter out;

    public Main(final InputReader in, final PrintWriter out) {
        this.in = in;
        this.out = out;
    }

    private static PrintWriter getOutput(final String filename) throws IOException {
        if (filename == null || filename.isEmpty()) {
            return new PrintWriter(new OutputStreamWriter(System.out));
        } else {
            return new PrintWriter(new FileWriter(filename + ".out"));
        }
    }

    public static void main(final String[] args) throws NumberFormatException, IOException {
        final String filename = "";
        final long time = System.currentTimeMillis();
        try (final InputReader in = new InputReader(filename); final PrintWriter out = getOutput(filename)) {
            new Main(in, out).solve();
        }
//        System.err.println("Running time: " + (System.currentTimeMillis() - time));
    }

    //TODO what if only one photo
    private void solve() throws IOException {
        final int n = in.nextInt();
        final long a = in.nextInt();
        final long b = in.nextInt();
        long t = in.nextInt();

        final char[] orientation = in.readLine().toCharArray();

        t -= 1 + (orientation[0] == 'h' ? 0 : b);
        if (t < 0) {
            out.println(0);
            return;
        }

        int best = 1;
        final long[] goNext = new long[n];
        for (int i = 1; i < n; i++) {
            goNext[i] = goNext[i - 1] + a + 1 + (orientation[i] == 'h' ? 0 : b);
            if (goNext[i] <= t) {
                best = Math.max(best, i + 1);
            }
        }
        final long[] goPrev = new long[n];
        for (int i = 1; i < n; i++) {
            goPrev[i] = goPrev[i - 1] + a + 1 + (orientation[n - i] == 'h' ? 0 : b);
            if (goPrev[i] <= t) {
                best = Math.max(best, i + 1);
            }
        }

        //first next then prev
        for (int i = 0; i < n; i++) {
            final long leftTime = t - goNext[i] - a * i;
            if (leftTime <= 0) break;
            best = Math.max(best, 1 + i + query(goPrev, leftTime));
        }
        //first prev then next
        for (int i = 0; i < n; i++) {
            final long leftTime = t - goPrev[i] - a * i;
            if (leftTime <= 0) break;
            best = Math.max(best, 1 + i + query(goNext, leftTime));
        }

        out.println(Math.min(best, n));
    }

    private int query(final long[] array, final long bound) {
        int l = 0, r = array.length - 1;
        while (l < r) {
            final int m = (l + r) / 2 + (l + r) % 2;
            if (array[m] > bound) {
                r = m - 1;
            } else {
                l = m;
            }
        }
        return l;
    }


    private void assertTrue(final boolean t) {
        if (!t) throw new RuntimeException();
    }
}

class InputReader implements Closeable {
    private StringTokenizer st;
    private final BufferedReader in;

    public InputReader(final String filename) throws IOException {
        if (filename == null || filename.isEmpty())
            in = new BufferedReader(new InputStreamReader(System.in));
        else
            in = new BufferedReader(new FileReader(filename + ".in"));
    }

    public boolean hasNextToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            String line = in.readLine();
            if (line == null)
                return false;
            st = new StringTokenizer(line);
        }
        return true;
    }

    public String nextToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            String line = in.readLine();
            if (line == null)
                return null;
            st = new StringTokenizer(line);
        }
        return st.nextToken();
    }

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

    public int nextInt() throws NumberFormatException, IOException {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws NumberFormatException, IOException {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(nextToken());
    }

    @Override
    public void close() throws IOException {
        in.close();
    }
}