from sys import stdin, stdout
from collections import Counter, defaultdict
from itertools import permutations, combinations
from bisect import bisect
raw_input = stdin.readline
pr = stdout.write


def in_num():
    return int(raw_input())


def in_arr():
    return map(int,raw_input().split())


def pr_num(n):
    stdout.write(str(n)+'\n')


def pr_arr(arr):
    pr(' '.join(map(str,arr))+'\n')

# fast read function for total integer input

def inp():
    # this function returns whole input of
    # space/line seperated integers
    # Use Ctrl+D to flush stdin.
    return map(int,stdin.read().split())

range = xrange # not for python 3.0+

n,a,b,t=in_arr()
s=[1+b*int(i=='w') for i in raw_input().strip()]
dp=[]
sm=0
for i in range(n-1,-1,-1):
    sm+=s[i]
    dp.append(sm)
    sm+=a
sm=0
ans=0
for i in range(n):
    sm+=s[i]
    if sm<=t:
        #print ans,i+1
        ans=max(ans,i+1)
        
    temp=t-sm-(a*2)
    
    if temp<0:
        sm+=a
        continue
    #print i+1,temp,bisect(dp,temp),dp
    ans=max(ans,i+1+min(n-i-1,bisect(dp,temp)))
    sm+=a
pr_num(ans)
    
    
    

