n,a,b,T=map(int,input().split())
ch=input()
l=[]
l.append((ord(ch[0])-104)//15 * b + 1)
for i in range(1,n):
  l.append((ord(ch[i])-104)//15 * b + 1 + a)

#code ascci: h=104  w=119  différence=15
   
if(l[0]==T):
  print(1)
elif (l[0]>T):
  print(0)
else:
  t=l[0]
  i=1
  while(i<n):
    nb=i
    t+=l[i]
    if (t>T):
      i=n
      #i=n pour sortir du while
    i+=1
  i=nb
  while(i>=1 ):
    j=1
    while(j<n and i+j<=n):
      if (j+i<=nb):
        j+=1
      else:
        t=sum(l[1:i])+sum(l[n-j:n])+a*(i-1)
        if(t<=T):
          nb=i+j
          j+=1
        else:
          j=n
    i-=1
  print(nb)
  
  