#include<bits/stdc++.h>
using namespace std;

//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
#define bitcount    __builtin_popcountll
#define sd(x) scanf("%d",&x)
#define slld(x) scanf("%lld",&x)
#define rep(i,x,y) for(i=x;i<y;i++)
#define ss(x) scanf("%s",x)
#define pf(x,y) printf("x",y)
#define pb push_back

vector <int> k,q;
string x;
int main()
{
    int n,a,b,t,i;
    sd(n);
    sd(a);
    sd(b);
    sd(t);
    cin>>x;


    int s=0;
    long long int ans=0;
    if(x[0]=='w')
    {
        ans+=b;
        s=1;
    }
    ans++;
    k.pb(ans);
    if(ans>t)
    {
        printf("0");
        return 0;
    }

    for(i=1;i<n;i++)
    {
        ans+=a;

        if(s==0&&x[i]=='w')
            ans+=b;
        if(s==1&&x[i]=='h')
            ans+=b;

        ans++;

        if(ans>t)
        {

            break;
        }

        if(x[i]=='w')
            s=1;
        else
            s=0;
        k.pb(ans);

    }

    ans=0;
    s=0;
    if(x[0]=='w')
    {
        ans+=b;
        s=1;
    }
    ans++;
    //q.pb(ans);
    for(i=n-1;i>0;i--)
    {
        ans+=a;

        if(s==0&&x[i]=='w')
            ans+=b;
        if(s==1&&x[i]=='h')
            ans+=b;

        ans++;

        if(ans>t)
        {
            break;
        }

        if(x[i]=='w')
            s=1;
        else
            s=0;

        q.pb(ans);

    }




    int f=0;
    for(i=0;i<k.size();i++)
    {

        f=max(i+1+upper_bound(q.begin(), q.end(), t-k[i])- q.begin(),f);
        //printf("%d\n",f);

    }

    printf("%d",min(f,n));







	return 0;
}
