n,a,b,t=map(int,input().split());ans=0
s=input()
l=r=ti=0
if s[0]=='h': ti=1
else: ti=1+b
for i in range(n):
    if ti>=t: break
    l-=1
    if s[l]=='h': ti+=1+a
    else: ti+=1+a+b
    ans=i+1
for j in range(n):
    if l==0: break
    r+=1
    if s[r]=='h':ti+=1+a
    else: ti+=1+a+b
    if ti>t:
        while ti>t:
            l+=1
            ti-=(a+b+1)
    if r-l>ans: ans=r-l
print(ans)