import sys

def main():
    n, a, b, T = map(int, raw_input().split())
    arr = []
    for char in raw_input():
        c = 1 + (b if char == 'w' else 0)
        arr.append(c)

    if T < arr[0]:
        return 0

    T -= arr[0]
    arr[0] = 0
    viewed = 1
    cur = 0
    while T - a > 0:
        i, j = cur, cur
        si, sj = 0, 0
        it, jt = 1, 1
        while arr[i] != 1:
            tempi = (i + 1) % n
            tsi = a + arr[tempi]
            if T < tsi + si:
                break

            i = tempi
            si += tsi
            it += 1

            if it == n - 1:
                break

        while arr[j] != 1 and T > sj:
            tempj = n - 1 if j == 0 else j - 1
            tsj = a | arr[j]
            if T < tsj + sj:
                break

            j = tempj
            sj += tsj
            jt += 1

            if jt == n - 1:
                break

        left = (it == n - 1 and arr[i] != 1) or jt > it
        if not left:
            r = range(cur + 1, i + 1)
        else:
            r = range(j - 1 or n - 1, cur)

        for k in r:
            T -= a + arr[k]
            arr[k] = 0
            viewed += 1

        if viewed == n:
            break

    return viewed


if __name__ == '__main__':
    print main()
