from sys import stdout
from sys import stdin
def get():
    return stdin.readline().strip()
def getf():
    return [int(i) for i in get().split()]
def put(a, end = "\n"):
    stdout.write(str(a) + end)
def putf(a, sep = " ", end = "\n"):
    stdout.write(sep.join([str(i) for i in a]) + end)

def solve1(n, a, b, t, q):
    tcur = 0
    ans = 0
    i = 0
    usd = [0] * n
    for i in range(n):
        if(q[i] == "h"):
            tcur += 1
            if(tcur <= t):
                ans += 1
            else:
                break
        elif(q[i] == "w"):
            tcur += b + 1
            if(tcur <= t):
                ans += 1
            else:
                break
        i += 1
        tcur += a
    return ans

def solve2(n, a, b, t, p, q):
    ans = 0
    pr_r = [0] * (n)
    pr_l = [0] * (n)
    d = {"w" : b, "h" : 0}
    pr_r[0] = 0
    pr_l[0] = 0
    for i in range(1, n):
        pr_r[i] = pr_r[i - 1] + d[p[i - 1]] + 1 + a
        pr_l[i] = pr_l[i - 1] + d[q[i - 1]] + 1 + a
    t -= (d[p[0]] + 1)
    for rr in range(1, n):
        for ll in range(1, n - rr - 1):
            if(pr_r[rr] + pr_l[ll] + rr <= t):
                ans = max(ans, rr + ll + 1)
    return ans
    
#from collections import defaultdict as dd
#from random import shuffle, randint
def bruh():
    n, a, b, t = getf()
    p = [i for i in get()]
    q = [p[0]] + p[1 :][ :: -1]
    res1 = max(solve1(n, a, b, t, p), solve1(n, a, b, t, q))
    res2 = max(solve2(n, a, b, t, p, q), solve2(n, a, b, t, q, p))
    put(max(res1, res2))
bruh()
