import sys
import pdb


def main():
    n, a, b, T = map(int, raw_input().split())
    arr = [None for _ in xrange(2 * n)]
    s = 0
    it = 0
    for char in raw_input():
        c = 1 + (b if char == 'w' else 0)
        arr[it] = arr[it + n] = c
        s += c
        it += 1

    l, r, max_length = 0, n, 0
    while l <= n and r < 2 * n:
        s += arr[r]
        r += 1
        while r - l > n or s + (r - l - 1 + min(r - n - 1, n - l)) * a > T:
            s -= arr[l]
            l += 1

        max_length = max(max_length, r - l)
        if max_length == n:
            break

    return max_length



if __name__ == '__main__':
    print main()

