#include <bits/stdc++.h>
using namespace std;
template <typename T>
T sqr(T x) {
  return x * x;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n, A, B, T;
  cin >> n >> A >> B >> T;
  string s;
  cin >> s;
  vector<bool> a(n);
  for (int i = 0; i < n; i++)
    if (s[i] == 'w') a[i] = true;
  int ans = 0;
  for (int iter = 0; iter < 2; iter++) {
    vector<int> dp(n);
    for (int i = n - 1; i >= 1; i--) {
      dp[i] = 1 + (a[i] ? B : 0) + A;
      if (i != n - 1) dp[i] += dp[i + 1];
    }
    int pr = 1;
    int cur = 0;
    for (int i = 0; i < n; i++) {
      cur += 1 + (a[i] ? B : 0);
      if (i) cur += A;
      if (cur > T) break;
      while (pr < n && dp[pr] + cur + i * A > T) pr++;
      ans = max(ans, i + n - pr + 1);
    }
    reverse(a.begin() + 1, a.end());
  }
  cout << min(n, ans) << "\n";
  return 0;
}
