#include <bits/stdc++.h>
using namespace std;
int n, a, b, t, sum[500005 + 500005];
char s[500005 + 500005];
bool ok(int x) {
  for (int i = (n - x + 1); i <= (n); i++) {
    int l = n - i, r = i + x - 1 - n;
    long long cost = (long long)(l + r + min(l, r)) * a + sum[i + x] - sum[i];
    if (cost <= t) return 1;
  }
  return 0;
}
int main() {
  scanf("%d %d %d %d %s", &n, &a, &b, &t, s);
  for (int i = (0); i < (n); i++) s[i + n] = s[i];
  for (int i = (1); i <= (n + n); i++)
    sum[i] = 1 + sum[i - 1] + (s[i - 1] == 'w') * b;
  int l = 0, h = n;
  while (l < h) {
    int mid = l + h + 1 >> 1;
    if (ok(mid))
      l = mid;
    else
      h = mid - 1;
  }
  printf("%d\n", l);
  scanf("\n");
}
