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

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

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

best = 0
for l, t in enumerate(dp1):
    r = T - t
    if r < 0:
        continue
    i, j = 0, len(dp2)-1
    while i < j:
        m = (i + j) / 2
        if dp2[m] < r:
            i = m + 1
        else:
            j = m - 1
    i = max(i-2, 0)
    while i < len(dp2) and dp2[i] <= r:
        i += 1
    best = max(best, i - 1 + l)

print min(best, n)