n,a,b,T=map(int,input().split())
ch=input()

#code ascii h = 104
#code ascii w = 119
# 119-104 = 15

i1 = 0
i2 = 0
t = 0
while (i1 < n and t < T):
  t += 1 + ((ord(ch[i1]) - 104)//15 ) * b
  if (t <= T):
    i1+=1
    t+=a

t = 1 + ((ord(ch[i2]) - 104)//15 ) * b
while (i2 < n and t < T):
  if (t <= T):
    i2+=1
    t+=a
    t += 1 + ((ord(ch[len(ch)-i2]) - 104)//15 ) * b


print (max(i1,i2))

