n, a, b, T = map(int, raw_input().split())
s = list(raw_input())
# print s

pre = [0]*(n+1)
suff = [0]*(n+1)

for i in range(1, n+1):
	pre[i] = pre[i-1] + 1 + (b if s[i-1] == 'w' else 0)

for i in range(1, n+1):
	j = n-i
	suff[j] = suff[j+1] + 1 + (b if s[j] == 'w' else 0)

# print pre, suff

l = 0; r = 0; ans = -1
#invariant 0--l and r+1 to n-1
while l<n and r<n:

	cT = pre[l+1]+suff[r]+\
				2*a*(min(l+1,n-(r+1))-1)+a*(max(l+1,n-(r+1))-1)

	# print l, r, cT
	
	while l<n and r<n and cT > T:
		r += 1
		cT = pre[l+1]+suff[r]+\
				2*a*(min(l+1,n-(r+1))-1)+a*(max(l+1,n-(r+1))-1)
	

	ans = max(ans, cT)
	
	l += 1

	if l > r:
		r = l

print l+1+n-(r+1)-1