#include <bits/stdc++.h>
using namespace std;
int n, a, b, T;
int f(int l, int r) { return (min(l, r) * 2 + max(l, r)) * a; }
int main() {
  string s;
  cin >> n >> a >> b >> T >> s;
  T -= (s[0] == 'w') * b + 1;
  if (T < 0) {
    puts("0");
    return 0;
  }
  vector<int> lc(n + 1), rc(n + 1);
  for (int i = n - 1; i > 0; --i) {
    lc[n - i] = lc[n - i - 1] + (s[i] == 'w') * b + 1;
  }
  for (int i = 1; i < n; ++i) {
    rc[i] = rc[i - 1] + (s[i] == 'w') * b + 1;
  }
  int ans = 1;
  for (int l = 0; l < n; ++l) {
    if (l * a + lc[l] <= T) ans = max(ans, l + 1);
  }
  for (int r = 0; r < n; ++r) {
    if (r * a + rc[r] <= T) ans = max(ans, r + 1);
  }
  if (ans == n) {
    cout << n << '\n';
    return 0;
  }
  int r = 0;
  for (int l = 0; l < n; ++l) {
    while (lc[l] + rc[r + 1] + f(l, r + 1) <= T) {
      ++r;
    }
    while (lc[l] + rc[r] + f(l, r) > T) {
      --r;
      if (r < 0) break;
    }
    if (r < 0) break;
    ans = max(ans, l + r + 1);
  }
  ans = min(ans, n);
  cout << ans << '\n';
}
