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

if n == 1:
  print(1); exit();

l = [0] * n
r = [0] * n

c = lambda i : a + 1 + (p[i] == 'w') * b

r[0] = c(0)-a
for i in range(1, n):
  r[i] = r[i-1] + c(i)

l[0] = c(0)-a
for i in range(1, n):
  l[i] = l[i-1] + c(n-i)

#print(l, r)

from bisect import bisect_left

def solve(l, r):
  res = 0
  for i in range(n):
    if r[i] <= T:
      res = max(res, i + 1)
    if r[i] + i <= T:
      rem = T - (r[i] + i)
      j = bisect_left(l, rem, 1, n - 1)
      res = max(res, i + j)
  return res

res = solve(l, r)
#print(res)
res = max(res, solve(r, l))
#print (res)

print(min(res, n))