# -*- coding: utf-8 -*-

def check(l, r):
    if 2 * L[l] + R[r] + l + r + 1 > T:
        return False
    if L[l] + 2 * R[r] + l + r + 1 > T:
        return False
    return True


n, a, b, T = map(int, input().split())
t_s = input()
s = [t_s[i] == "w" for i in range(n)]

R = [0] * n
L = [0] * n
R[0] = b * s[0]
L[0] = b * s[0]
for i in range(1, n):
    R[i] += a + b * s[i] + R[i - 1]
    L[i] += a + b * s[-i] + L[i - 1]

r = 0
ma = 0
for l in range(n)[::-1]:
    while r < n and check(l, r):
        r += 1
        ma = max(ma, l + r + 1)

print(ma)
