n, a, b, T = raw_input().split(' ')
n = int(n)
a = int(a)
b = int(b)
T = int(T)
pho = raw_input()
pho = "0" + 3 * pho
sum = [0 for i in xrange(3 * n + 1)]
for i in xrange(1, 3 * n + 1):
    if pho[i] == 'w':
        sum[i] = sum[i - 1] + 1
    else:
        sum[i] = sum[i - 1]
def f(L, R):
    return R - L + 1 + b * (sum[R] - sum[L - 1]) + a * (min(n + 1 - L, R - n - 1) + R - L)

ans = 0
'''
r = n + 1
for i in xrange(2, n + 1):
    L = n + 1
    R = r
    while L < R:
        if L + 1 == R:
            break
        M = (L + R) >> 1
        if f(i, M) <= T:
            L = M
        else:
            R = M - 1
    if f(i, L) <= T:
        ans = max(ans, L - i + 1)
    if f(i, R) <= T:
        ans = max(ans, R - i + 1)
    r += 1
l = 2
for i in xrange(n + 1, 2 * n):
    L = l
    R = n
    while L < R:
        if L + 1 == R:
            break
        M = (L + R) >> 1
        if f(M, i) <= T:
            R = M
        else:
            L = M + 1
    if f(L, i) <= T:
        ans = max(ans, i - L + 1)
    if f(R, i) <= T:
        ans = max(ans, i - R + 1)
    l += 1
print ans
'''
L = 2
R = n + 1
while L <= R and L <= n + 1 and R <= 2 * n:
    if R - L + 1 <= n and f(L, R) <= T:
        ans = max(ans, R - L + 1)
        R += 1
    else:
        L += 1
print ans