#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL),cout.tie(NULL);
    int n,a,b,T;
    cin>>n>>a>>b>>T;
    string s;
    cin>>s;		// w-horiz, h-vertical
    int pref[n+1]={0},suff[n+1]={0};
    for(int i=0;i<n;i++)
    {
    pref[i]+=pref[max(i-1,0)];
    pref[i]+=s[i]=='w'?b+1:1;
    pref[i]+=(i>0)*a;
    suff[i]+=suff[max(i-1,0)];
	suff[i]+=s[n-1-i]=='w'?b+1:1;
	suff[i]+=a;
	}
	if(suff[n-1]<=T)
	{
		cout<<n<<endl;
		return 0;
	}
	int ans=0;
	for(int i=0;i<n;i++)
	{
		ll time=(ll)(pref[i]);
		
		if(time>T) 
			break;

		ll left=T-time-(a*i);
		int lb=lower_bound(suff,suff+n,left)-suff;
		if(suff[lb]>left) lb--;

		ans=max(ans,i+2+lb);
	}
	for(int i=0;i<n;i++)
	{
			ll time=(ll)(suff[i])+pref[0];
		
		if(time>T) 
			break;

		ll left=T-time-(a*(i+1));
		int lb=lower_bound(pref+1,pref+n,left)-pref;
		if(pref[lb]>left) lb--;
	
		ans=max(ans,i+2+lb);
	}
	cout<<ans<<endl;
}