#include <bits/stdc++.h>
using namespace std;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
string text;
int usef[500005], useb[500005];
int main() {
  int n, a, b, T;
  cin >> n >> a >> b >> T;
  cin >> text;
  int t = 0;
  for (int i = 0; i < n; i++) {
    if (text[i] == 'w') t += b;
    t++;
    usef[i] = t;
  }
  t = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (text[i] == 'w') t += b;
    t++;
    useb[i] = t;
  }
  int ans = 0;
  for (int u = 0; u < n; u++) {
    if (usef[u] + u * a > T) break;
    int low = u + 1, high = n - 1;
    while (low <= high) {
      int mid = (low + high) / 2;
      if (usef[u] + useb[mid] + min(u, n - mid) * 2 * a +
              max(u, (n - mid)) * a >
          T)
        low = mid + 1;
      else
        high = mid - 1;
    }
    ans = max(ans, n - low + 1 + u);
  }
  cout << ans << "\n";
  return 0;
}
