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);
    for (var i = 1; i < n; i++) {
        if (fwdTimes[i - 1] <= T)
            fwdTimes[i] = fwdTimes[i - 1] + 1 + a + (imgs[i] != imgs[i - 1] ? b : 0);
        if (revTimes[i - 1] <= T)
            revTimes[i] = revTimes[i - 1] + 1 + a + (imgs[n - i] != imgs[i == 1 ? 0 : n - i + 1] ? b : 0);
    }
    if (revTimes.length > fwdTimes.length) {
        var tmp = fwdTimes;
        fwdTimes = revTimes;
        revTimes = tmp;
    }
    if (fwdTimes.length == 1)
        return 0;
    if (fwdTimes.length >= n)
        return n;
    var start = 0, end = fwdTimes.length - 1;
    var current = end;
    while (end - 1 > start) {
        var mid = Math.floor((start + end) / 2);
        var remain = T - fwdTimes[mid] - mid * a;
        var rev = 0;
        for (var i = 1; i < n; i++) {
            rev = i;
            if (revTimes[i] > remain) {
                rev--;
                break;
            }
        }
        rev += mid + 1;
        if (rev > current) {
            end = mid + 1;
            current = rev;
        } else {
            start = mid;
        }
    }
    return current;
}
function readNums() {
    return readline().split(' ').map(v => v - 0);
}
