#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template <typename T, typename Cmp=less<T>>
  using oset = tree<T, null_type, Cmp, rb_tree_tag,
		    tree_order_statistics_node_update>;

typedef long long lint;

const int N=500010;

char str[N];
int ah[N], bk[N];

int search(int from, int to, int t) {
	if (bk[to]>t) return 0;
	if (bk[from]<=t) return to-from+1;
	int x=to;
	while (from<to) {
		int mid=(from+to)/2;
		if (bk[mid]<=t) to=mid;
		else from=mid+1;
	}
	return x-to+1;
}

int main() {
	int n, a, b, T, ans=0;
	scanf("%d %d %d %d", &n, &a, &b, &T);
	scanf("%s", str);
	for (int i=0; i<n; i++){
		ah[i]=(i?ah[i-1]+a:0)+1+(str[i]=='w'?1:0)*b;
	}
	for (int i=n-1; i>=0; i--) {
		bk[i]=(i==n-1?0:bk[i+1]+a)+1+(str[i]=='w'?1:0)*b;
	}
	for (int i=0; i<n; i++) {
		if (ah[i]>T) break;
		int t=T-ah[i]-(i+1)*a;
		ans=max(ans, i+1+search(i+1, n-1, t));
	}
	reverse(str, str+n);
	for (int i=0; i<n; i++){
		ah[i]=(i?ah[i-1]+a:0)+1+(str[i]=='w'?1:0)*b;
	}
	for (int i=n-1; i>=0; i--) {
		bk[i]=(i==n-1?0:bk[i+1]+a)+1+(str[i]=='w'?1:0)*b;
	}
	for (int i=0; i<n; i++) {
		if (ah[i]>T) break;
		int t=T-ah[i]-(i+1)*a;
		ans=max(ans, i+1+search(i+1, n-1, t));
	}
	printf("%d\n", ans);
	return 0;
}
