n,a,b,t = map(int, input().split())
s = input()
A = [0] * (n-1)
per = 0
cou = 0
for i in range(n-1,0,-1):
    cou += (a+ (b if s[i] == 'w' else 0) + 1)
    A[per] = cou
    per+=1
B = [0] * (n-1)
per = 0
cou = 0
for i in range(1, n):
    
    cou += (a+ (b if s[i] == 'w' else 0) + 1)
    
    B[per] = cou
    per+=1
answer = 0
cou = (b if s[0] == 'w' else 0) + 1
for i in range(n-1):
    B[i] += cou
answer = 0
if cou <= t:
    answer = 1
if answer == 0:
    print(0)
else:
    ind = n-2
    for i in range(n-1):
        if A[i] + cou > t:
            ind = i-1
            break
   
        
    for i in range(n-1):
        if B[i] <= t:
            
            if ind >= 0:
                con = t - (B[i] + (i+1) * a)
                per = 0
                for j in range(ind, -1,-1):
                    if A[j] <= con:
                        per = 1
                        ind = j
                        break
                if per == 0:
                    ind = -1
                    answer = max(answer, 2+i)
                else:
                    answer = max(answer, 1 + (min((1+i) + (1+ind),n-1)))
            else:
                answer = max(answer, 2+i)
                
        else:
            break
    print(answer)
 