#include <bits/stdc++.h>
using namespace std;
const int MAX = 5e5 + 17;
long long ls[MAX], rs[MAX];
int n, a, b, T;
string s;
int main() {
  cin >> n >> a >> b >> T;
  cin >> s;
  long long st = 1 + (s[0] == 'w' ? b : 0);
  if (st > T) {
    cout << "0\n";
    return 0;
  }
  rs[0] = 0;
  for (int i = 1; i < n; i++) rs[i] = rs[i - 1] + a + 1 + (s[i] == 'w' ? b : 0);
  ls[0] = 0;
  for (int i = 1; i < n; i++)
    ls[i] = ls[i - 1] + a + 1 + (s[n - i] == 'w' ? b : 0);
  if (ls[n - 1] + st <= T || rs[n - 1] + st <= T) {
    cout << n << '\n';
    return 0;
  }
  int ans = 0;
  for (int i = 1; i < n; i++) {
    if (st + ls[i] <= T || st + rs[i] <= T) ans = max(ans, i + 1);
  }
  int j = n - 1;
  for (int i = 1; i < n; i++) {
    while (j > 0) {
      long long cost = st + rs[i] + i * (long long)a + ls[j];
      if (cost > T)
        j--;
      else
        break;
    }
    if (j > 1) ans = max(ans, i + j + 1);
  }
  j = n - 1;
  for (int i = 1; i < n; i++) {
    while (j > 0) {
      long long cost = st + ls[i] + i * (long long)a + rs[j];
      if (cost > T)
        j--;
      else
        break;
    }
    if (j > 1) ans = max(ans, i + j + 1);
  }
  cout << ans << '\n';
  return 0;
}
