#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cout << *it << " = " << a << "\n";
  err(++it, args...);
}
const long long N = 2e5 + 5, M = 1e9 + 7, inf = 1e18;
string s;
int n, a, b, t;
vector<int> calc(string s) {
  int cur = 0;
  vector<int> ans;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'w') {
      cur += b;
    }
    cur += 1;
    ans.push_back(cur);
    cur += a;
  }
  return ans;
}
int solve(string s) {
  vector<int> dp, dpr;
  dp = calc(s);
  reverse(s.begin(), s.end());
  dpr = calc(s);
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int rem = t - dp[i];
    if (rem < 0) continue;
    ans = max(ans, i + 1);
    rem -= a * (i + 1);
    if (rem < 0) continue;
    int also = upper_bound(dpr.begin(), dpr.end(), rem) - dpr.begin();
    ans = max(ans, i + 1 + also);
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  cin >> n >> a >> b >> t;
  cin >> s;
  int ans = 0;
  ans = max(ans, solve(s));
  reverse(1 + s.begin(), s.end());
  ans = max(ans, solve(s));
  cout << min(n, ans);
}
