import sys
import pdb

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
        ib, jb = False, False
        si, sj = 0, 0
        it, jt = 0, 0
        while arr[i] != 1:
            tempi = (i + 1) % n
            tsi = a + arr[tempi]
            if T < tsi + si:
                ib = True
                break

            i = tempi
            si += tsi
            if arr[i]:
                it += 1

            if (i + 1) % n == cur:
                break

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

            j = tempj
            sj += tsj
            if arr[j]:
                jt += 1

            if (j - 1 if j != 0 else n - 1) == cur:
                break

        if it != 0 or jt != 0:
            if it == jt:
                right = not ib
            elif (ib and jb) or (not ib and not jb):
                right = it > jt
            elif ib and not jb:
                right = False
            elif jb and not ib:
                right = True

            dest = j if not right else i
        else:
            return viewed

        k = cur
        while k != dest:
            k = (k - 1 if k != 0 else n - 1) if not right else (k + 1) % n
            T -= (a + arr[k])
            if T < 0:
                break

            if arr[k]:
                arr[k] = 0
                viewed += 1

        cur = dest

        if viewed == n:
            break

    return viewed


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

