#include <bits/stdc++.h>
using namespace std;
long long ar[500005], br[500005];
int main() {
  long long n, a, b, T;
  memset(ar, 0, sizeof ar);
  memset(br, 0, sizeof br);
  string s;
  cin >> n >> a >> b >> T;
  cin >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'w') ar[i] = b;
    ar[i]++;
  }
  br[0] = ar[0];
  for (int i = 1; i < n; i++) br[i] = br[i - 1] + ar[i] + a;
  long long costi = 0, costj = 0, cost = 0, ans = 1, ansi = 1;
  if (s[0] == 'w' && T < 1 + b) ans = 0, ansi = 0;
  for (int i = 0; i < n; i++) {
    costi = br[i];
    int low = i + 1, high = n;
    int mid = (low + high) / 2, st = 0;
    while (low < n) {
      cost = costi + br[n - 1] - br[mid - 1] + min(i * a, (n - mid) * a);
      if (cost > T) {
        low = mid;
      } else {
        high = mid;
        ansi = n - mid + i + 1;
        if (ansi > ans) {
          ans = ansi;
        }
      }
      mid = (low + high) / 2;
      if (st) break;
      if (mid == low) st = 1;
    }
  }
  cout << ans;
  return 0;
}
