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]
    it, cit, ct = 1, 0, 0
    while it < n:
        ts = a + arr[it]
        if T - ts < 0:
            break

        T -= ts
        if (it + 1) * a <= T:
            cit = it
            ct = T

        it += 1

    max_length = it
    if max_length == n:
        return n

    l = 0
    r = cit
    ct -= cit * a

    while r != (cit + 1) % n and max_length != n:
        if l == r:
            break

        tl = l - 1 if l != 0 else n - 1
        ts = a + arr[tl]
        if ct >= ts:
            l = tl
            ct -= ts
        else:
            ct += a + arr[r]
            r = r - 1 if r != 0 else n - 1

        tlgth = r - l if r > l else n - l + r + 1
        if tlgth > max_length:
            max_length = tlgth

    return max_length


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

