#include <set>
#include <map>
#include <queue>
#include <deque>
#include <cstdio>
#include <string>
#include <vector>
#include <math.h>
#include <time.h>
#include <utility>
#include <cstdlib>
#include <sstream>
#include <cstring>
#include <stdio.h>
#include <iomanip>
#include <conio.h>
#include <iostream>
#include <algorithm>
using namespace std;
long long n,a,b,T,ans,j;
char c[500010];
long long h[500010],w[500010];
int main(){
	ios::sync_with_stdio(false);
	cin>>n>>a>>b>>T;
	for(int i=1;i<=n;i++){
		cin>>c[i];
	}
	int x=a+b+1;
	int y=b+1;
	h[1]=(c[1]=='w')*b+1;
	for(int i=2;i<=n;i++){
		h[i]=h[i-1]+(c[i]=='w')*b+a+1;
	}
	for(int i=1;i<n;i++){
		w[i]=w[i-1]+(c[n-i+1]=='w')*b+a+1;
	}
	j=n-1;
	for(int i=1;i<=n;i++){
		if(h[i]>T)break;
		while(w[j]+h[i]+(abs(i-j)+1)*a>T&&j>0){
			j--;
		}
		ans=max(ans,i+j);
		ans=min(ans,n);
	}
	cout<<ans<<endl;
	return 0;
}