print(main.apply(0, readNums()));
function main(n, a, b, T) {
    var imgs = readline();
    var fwdTimes = [0], revTimes = [0];
    T -= 1 + (imgs[0] == 'w' ? b : 0);
    if (T < 0) return 0;
    var fwd = 1, rev = 1;
    for (var i = 1; i < n; i++) {
        fwdTimes[i] = fwdTimes[i - 1] + 1 + a + (imgs[i] == 'w' ? b : 0);
        if (fwdTimes[i] <= T) fwd++;
        revTimes[i] = revTimes[i - 1] + 1 + a + (imgs[n - i] == 'w' ? b : 0);
        if (revTimes[i] <= T) rev++;
    }
    return Math.max(solve(fwd, fwdTimes, revTimes), solve(rev, revTimes, fwdTimes));
    function solve(fwd, fwdTimes, revTimes) {
        var start = 0, end = fwd;
        if (end <= 0) return 0;
        if (end >= n) return n;
        var current = revCount(end - 1);
        while (end - 1 > start) {
            var mid = Math.floor((start + end) / 2);
            var remain = T - fwdTimes[mid] - mid * a;
            var val = revCount(mid);
            if (val > current) {
                end = mid + 1;
                current = val;
            } else {
                start = mid;
            }
        }
        return Math.min(current, n);
        function revCount(m) {
            var remain = T - fwdTimes[m] - m * a;
            var rev = 0;
            if (remain > 0) {
                for (var i = 1; i < n && revTimes[i] <= remain; i++) {
                    rev = i;
                }
            }
            return m + 1 + rev;
        }
    }
}
function readNums() {
    return readline().split(' ').map(v => v - 0);
}
/*INPUT
7 1 1000 13
hhhhwhh
*/