#include <bits/stdc++.h>

using namespace std;

int n, a, b, t, ans, dp[500005], dpp[500005];
vector <char> vec, vec1;
char ch[500005];


main()
{
    cin >> n >> a >> b >> t;
    for (int i=1;i<=n;i++)
    {
        cin >> ch[i];
        vec.push_back(ch[i]);
    }
    vec1.push_back(ch[1]);
    for (int i=n;i>=2;i--)
        vec1.push_back(ch[i]);
    int r=0, res=0;
    //if (vec[0]=='w')
    //res++;
    while (r<vec.size())
    {
        if (vec[r]=='w')
            res+=b;
        dp[r]=res;
        res+=a;
        res++;
        r++;
    }
    r=1, res=1+a;
    //if (vec1[0]=='w')
    while (r<vec1.size())
    {
        if (vec1[r]=='w')
            res+=b;
        dpp[r]=res;
        res+=a;
        res++;
        r++;
    }
    if (dp[0]>t)
    {
        cout << 0;
        return 0;
    }
    for (int i=0;i<vec.size();i++)
    {
        int x=dp[i];
        if (x>t)
            break;
        ans=max(ans, i+1);
        x+=a*(i);
        if (x>t)
            break;
        ans=max(min((upper_bound(dpp+1, dpp+n, t-x)-dpp)+i, n), ans);
    }
    /*for (int i=0;i<vec.size();i++)
    {
        int x=dpp[i];
        x+=a*(i);
        //cout << x << " ";
        if (x>t)
            break;
        ans=max(min((upper_bound(dp+1, dp+n, t-x)-dp)+i, n), ans);
        //cout << t-x+dp[0] << " ";
        //cout << (upper_bound(dp+1, dp+n, t-x+dp[0]))-dp-1 << " " << i << "\n";
    }*/
    cout << ans;
    return 0;
}
/*
16383
*/

