#include <bits/stdc++.h>
using namespace std;
inline int Readint() {
  int ret = 0;
  int f = 1;
  char ch;
  do {
    ch = getchar();
    if (ch == '-') f *= -1;
  } while (ch >= 0 && (ch < '0' || ch > '9'));
  while ('0' <= ch && ch <= '9') {
    ret = ret * 10 + ch - '0';
    ch = getchar();
  }
  return ret * f;
}
void open() {
  freopen("B.in", "r", stdin);
  freopen("B.out", "w", stdout);
}
void close() {
  fclose(stdin);
  fclose(stdout);
}
const int MAXN = 5E5 + 10;
int n, a, b, T;
int ans = 0;
char st[MAXN];
long long f[MAXN];
long long g[MAXN];
void init() {
  n = Readint();
  a = Readint(), b = Readint();
  T = Readint();
  scanf("%s", st + 1);
}
void work() {
  int ti = 0;
  f[1] = b * (st[1] == 'w') + 1;
  for (int i = 2, _END_ = n; i <= _END_; i++) {
    f[i] = f[i - 1] + a;
    f[i]++;
    if (st[i] == 'w') f[i] += b;
  }
  reverse(st + 2, st + 1 + n);
  g[1] = f[1];
  for (int i = 2, _END_ = n; i <= _END_; i++) {
    g[i] = g[i - 1] + a;
    g[i]++;
    if (st[i] == 'w') g[i] += b;
  }
  int tmp, res;
  tmp = lower_bound(f + 1, f + 1 + n, T) - f;
  if (f[tmp] > T) tmp--;
  ans = max(ans, tmp);
  tmp = lower_bound(g + 1, g + 1 + n, T) - g;
  if (g[tmp] > T) tmp--;
  ans = max(ans, tmp);
  for (int i = 2, _END_ = n; i <= _END_; i++)
    if (T > f[i] - f[1] + (i - 1) * a) {
      res = T - f[i] + f[1] - (i - 1) * a;
      tmp = lower_bound(g + 1, g + 1 + n, res) - g;
      if (g[tmp] > res) tmp--;
      if (tmp > 1) {
        tmp = n + 2 - tmp;
        if (i < tmp)
          ans = max(ans, i + n - tmp + 1);
        else
          ans = n;
      }
    }
  int hh;
  for (int i = 2, _END_ = n; i <= _END_; i++)
    if (T > g[i] - g[1] + (i - 1) * a) {
      res = T - g[i] + g[1] - (i - 1) * a;
      tmp = lower_bound(f + 1, f + 1 + n, res) - f;
      if (f[tmp] > res) tmp--;
      hh = n + 2 - i;
      if (tmp < hh)
        ans = max(ans, tmp + n - hh + 1);
      else
        ans = n;
    }
  printf("%d\n", ans);
}
int main() {
  int _ = 0;
  init();
  work();
  close();
  return 0;
}
