#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <iostream>
using namespace std;

const double pi=acos(-1.0);
double eps=0.000001;  

char tm[500005];
__int64 ll[500005];
__int64 rr[500005];

int main()
{ 
	__int64 n,a,b,t;
	scanf("%I64d %I64d %I64d %I64d",&n,&a,&b,&t);
	scanf("%s",tm+1);
	__int64 tmp=t;
	__int64 pay;
	__int64 i;
	
	__int64 maxx=0;
	for (i=1;i<=n;i++)
	{
		if (tm[i]=='w') pay=b+1; 
		else pay=1;
		if (tmp>=pay) tmp-=pay;
		else break;
		ll[i]=t-tmp;
		if (tmp<a) {i++;break;}
		tmp-=a;
	} 
	for (;i<=n;i++)
		ll[i]=1e9+1;

	tmp=t;
	for (i=n;i>=1;i--)
	{ 
		if (tm[i]=='w') pay=b+1; 
		else pay=1;
		if (tmp>=pay) tmp-=pay;
		else break;
		rr[n-i+1]=t-tmp;
		if (tmp<a) {i--;break;}
		tmp-=a;
	} 
	
	for (;i>=1;i--)
		rr[n-i+1]=1e9+1;
	for (i=1;i<=n; i++)
	{
		if (ll[i]==1e9+1)break;
		if (t-ll[i]>a*i )
		{ 
				__int64 it=upper_bound(rr+1,rr+1+n,t-ll[i]-a*i)-rr;
				  it--;
			if (it+i>maxx) maxx=i+it;
		}
		if (t-ll[i]>=0)
		if (i>maxx) maxx=i;

	}
	for (i=1;i<=n;i++)
	{
		if (rr[i]==1e9+1) break;
		else
			rr[i]+=a;
	}
	for (i=1;i<=n; i++)
	{
		if (rr[i]==1e9+1)break;
		if (t-rr[i]>a*(i) )
		{ 
				__int64 it=upper_bound(ll+1,ll+1+n,t-rr[i]-a*(i))-ll;
				  it--;
			if (it+i>maxx) maxx=i+it;
		}
		if (t-rr[i]>=0)
		if (i>maxx) maxx=i;

	}
	if (maxx>n) maxx=n;
	printf("%I64d\n",maxx);
	
	return 0;
}