# coding:utf-8
n,a,b,T = map(int, raw_input().split())
def func(c):
	return b+1 if c=='w' else 1

# s[i]表示看i点需要的花费
s = map(func, list(raw_input()))

# d[i]表示从0点到i点，全看一遍，需要的花费
d = s[:]
for x in xrange(1,len(s)):
	d[x] += d[x-1]

if sum(s)+a*(n-1) <= T:
	print n
else:
	# -> 0, 1, ..., x
	rcount = 0
	s1 = s[:]
	t = T
	i = 0
	while s1[i] <= t:
		rcount += 1
		t -= s1[i] + a
		s1[i] = 0
		i = (i+1)%n
	# print rcount

	# <- 0, n-1, ..., x
	lcount = 0
	s1 = s[:]
	t = T
	i = 0
	while s1[i] <= t:
		lcount += 1
		t -= s1[i] + a
		s1[i] = 0
		i = (i+n-1)%n
	# print lcount

	# -> 0, 1, ..., j-1, j, j-1, ..., x
	lrcount = 0
	for j in xrange(0,n):
		cnt = 0
		s1 = s[:]
		t = T
		i = 0
		step = 1 #方向步长
		while s1[i] <= t:
			cnt += 1
			t -= s1[i] + a
			s1[i] = 0
			if i == j:
				step = -step
				t -= a*j
			i = (i + step) % n
		lrcount = max(lrcount, cnt)
	# print lrcount

	# <- 0, n-1, ..., i+1, i, i+1, ..., x
	rlcount = 0
	for j in xrange(0,n):
		cnt = 0
		s1 = s[:]
		t = T
		i = 0
		step = -1 #方向步长
		while s1[i] <= t:
			cnt += 1
			t -= s1[i] + a
			s1[i] = 0
			if i == j:
				step = -step
				t -= a*(n-j)
			i = (i + step) % n
		rlcount = max(rlcount, cnt)
	# print rlcount

	print max(lcount, rcount, lrcount, rlcount)
