#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - 48, ch = getchar();
  }
  return x * f;
}
const int maxn = 501000;
char s[maxn];
int n, A, B, T;
int f1[maxn], f2[maxn];
void check1() {
  int now = n + 1, cnt = 0;
  for (int i = 1; i <= n - 1; i++) {
    cnt += A, cnt++;
    if (s[now - 1] == 'w') cnt += B;
    now--;
    f1[i] = cnt;
  }
}
void check2() {
  int now = 1, cnt = 0;
  for (int i = 1; i <= n - 1; i++) {
    cnt += A, cnt++;
    if (s[now + 1] == 'w') cnt += B;
    now++;
    f2[i] = cnt;
  }
}
int main() {
  n = read(), A = read(), B = read(), T = read();
  scanf("%s", s + 1);
  s[n + 1] = s[1];
  check1(), check2();
  int ans = 0, sum = 1;
  if (s[1] == 'w') sum += B;
  if (sum <= T) ans = 1;
  for (int i = 2; i <= n; i++) {
    sum++;
    sum += A;
    if (s[i] == 'w') sum += B;
    if (sum > T) break;
    ans = max(ans, i);
    int l = 0, r = n - 1;
    while (l <= r) {
      int mid = (l + r) / 2;
      if (f1[mid] + sum + (i - 1) * A > T)
        r = mid - 1;
      else
        l = mid + 1, ans = max(ans, min(mid + i, n));
    }
  }
  sum = 1;
  if (s[1] == 'w') sum += B;
  for (int i = n; i > 1; i--) {
    sum++;
    sum += A;
    if (s[i] == 'w') sum += B;
    if (sum > T) break;
    ans = max(ans, n - i + 2);
    int l = 0, r = n - 1;
    while (l <= r) {
      int mid = (l + r) / 2;
      if (f2[mid] + sum + (n - i + 1) * A > T)
        r = mid - 1;
      else
        l = mid + 1, ans = max(ans, min(mid + (n - i + 2), n));
    }
  }
  printf("%d\n", ans);
  return 0;
}
