# -*- coding: utf-8 -*-
class Photos(object):
	def __init__(self, n, a, b, T, s):
		self.n = n
		self.a = a
		self.b = b
		self.T = T
		self.s = s
		self.L = []
		if s[0] == 'h':
			self.L.append(1)
		else:
			self.L.append(1 + b)
		for i in range(1, n):
			if self.s[i] == 'h':
				self.L.append(1+a)
			else:
				self.L.append(1+a+b)
	
	def test(self):
		print self.L
		
	def cal(self):
		L = self.L
		tmp = sum(L)
		if tmp <= T:
			return n
		res = 0
		if L[0] <= T:
			res = 1
		i, j = n-1, n
		while i >= 1:
			tmp -= L[i]
			i = i - 1
			while T - tmp >= L[j-1]:
				j = j - 1
				tmp += L[j]
			if tmp <= T:
				#print 'fuck i = %d, j = %d' % (i, j)
				t = i + 1 + n - j
				if t > res:
					res = t
		return res
	
if __name__ == '__main__':
	n, a, b, T = map(int , raw_input().split())
	s = raw_input()
	photos = Photos(n, a, b, T, s)
	#photos.test()
	print photos.cal()
	