# 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()))

# print 'i:',range(n)
# print 's:',s

# 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 'r:',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 'l:',lcount

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

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

	print max(lcount, rcount, lrcount, rlcount)


'''
Input
10 2 3 32
hhwwhwhwwh
Output
8
Answer
7
'''
