#include <bits/stdc++.h>

#define all(x) (x).begin(), (x).end()
#define pb push_back
#define mp make_pair
#define FILE ""

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

const int INF = numeric_limits<int>::max();
const ll LLINF = numeric_limits<ll>::max();
const ull ULLINF = numeric_limits<ull>::max();
const double PI = acos(-1.0);

int n, a, b, t;
bool orie[500010];
string s;
int ans = 0;

int main()
{
//    freopen(FILE".in", "r", stdin);
//    freopen(FILE".out", "w", stdout);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin >> n >> a >> b >> t;
    for(int i = 0; i < n; i++)
    {
        char c;
        cin >> c;
        orie[i] = (c == 'w');
    }
    // n = 1
    vector<ll> cp(n), cs(n);
    cp[1] = 1 + a + orie[1];
    for(int i = 2; i < n; i++)
        cp[i] = cp[i - 1] + a + 1 + orie[i] * b;
    cs[n - 1] = 1 + orie[0] * b;
    for(int i = n - 2; i >= 0; i--)
        cs[i] = cs[i + 1] + 1 + a + orie[i + 1] * b;
    for(int i = n - 1; i >= 0; i--)
    {
        int moved = n - i - 1;
        if(cs[i] <= t)
            ans = max(ans, moved + 1);
        if(t > cs[i] + moved * a)
        {
            auto k = upper_bound(all(cp), t - cs[i] - moved * a) - cp.begin() - 1;
            ans = max(ans, min(k + moved + 1, n));
        }
    }
    reverse(orie + 1, orie + n);
    cp[1] = 1 + a + orie[1];
    for(int i = 2; i < n; i++)
        cp[i] = cp[i - 1] + a + 1 + orie[i] * b;
    cs[n - 1] = 1 + orie[0] * b;
    for(int i = n - 2; i >= 0; i--)
        cs[i] = cs[i + 1] + 1 + a + orie[i + 1] * b;
    for(int i = n - 1; i >= 0; i--)
    {
        int moved = n - i - 1;
        if(cs[i] <= t)
            ans = max(ans, moved + 1);
        if(t > cs[i] + moved * a)
        {
            auto k = upper_bound(all(cp), t - cs[i] - moved * a) - cp.begin() - 1;
            ans = max(ans, min(k + moved + 1, n));
        }
    }
    cout << ans;
    return 0;
}
