n,a,b,t=map(int,raw_input().split())
v=[1+('w'==x)*b for x in raw_input()]*2
i,j,s,x=0,n,sum(v[:n]),0
while i<=n and j<n*2:
  s+=v[j]
  j+=1
  while j-i>n or s+(j-i-1+min(j-1-n,n-i))*a>t:
    s-=v[i]
    i+=1
  x=max(x,j-i)
print x

