#include <bits/stdc++.h>
using namespace std;
int ok(int n, int a, int *s, int l, int r) {
  assert(l <= n && n <= r);
  int dist = r - l + min(n - l, r - n);
  if (r == n) dist = min(dist, n - l);
  if (l == n) dist = min(dist, r - n);
  return dist * a + s[r + 1] - s[l];
}
int main() {
  int n, a, b, t;
  assert(scanf("%d%d%d%d", &n, &a, &b, &t) == 4);
  int d[n + n];
  for (int i = 0; i < n; i++) {
    char c;
    assert(scanf(" %c", &c) == 1);
    d[i] = 1 + b * (c == 'w');
  }
  for (int i = 0; i < n; i++) d[n + i] = d[i];
  int s[2 * n + 1];
  s[0] = 0;
  for (int i = 0; i < (2 * n); i++) s[i + 1] = s[i] + d[i];
  int ans = 0;
  int l = 1, r = n;
  for (; l <= n; l++) {
    while (r - l + 1 <= n && ok(n, a, s, l, r) <= t) {
      r++;
      ans = max(ans, r - l);
    }
  }
  printf("%d\n", ans);
  return 0;
}
