from bisect import *

n, a, b, T = map(int, raw_input().split())
o = raw_input()

dp1 = [0]
f = True
for i in o:
    dp1.append(dp1[-1] + a + 1)
    if f:
        dp1[-1] -= a
        f = False
    if i == 'w':
        dp1[-1] += b

dp2 = [0]
f = True
for i in o[::-1]:
    dp2.append(dp2[-1] + a + 1)
    if f:
        dp2[-1] -= a
        f = False
    if i == 'w':
        dp2[-1] += b

best = 0
for l, t in enumerate(dp1):
    r = T - t
    if r < 0:
        continue
    i = bisect_right(dp2, r)
    best = max(best, i + l - 1)

print min(best, n)