#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
const long long mod = 1e9 + 7;
inline long long read() {
  long long X = 0;
  bool flag = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') flag = 0;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    X = (X << 1) + (X << 3) + ch - '0';
    ch = getchar();
  }
  if (flag) return X;
  return ~(X - 1);
}
long long n, m, k, t, a, b;
long long ans;
int ar[N];
char ch[N];
bool check(int x) {
  for (register int i(1); i <= x; ++i) {
    long long res;
    int bg = n + 2 - i;
    int ed = bg + x - 1;
    res = (n + 1 - bg) * a + (ed - bg) * a;
    res = min(res, (ed - n - 1 + ed - bg) * a);
    res += (ar[ed] - ar[bg - 1]) * b + ed - bg + 1;
    if (res <= t) return true;
  }
  return false;
}
void solvve() {
  n = read();
  a = read();
  b = read();
  t = read();
  scanf("%s", ch + n + 1);
  for (register int i(1); i <= n; ++i) ch[i] = ch[n + i];
  for (register int i(1); i <= 2 * n; ++i)
    ar[i] = ch[i] == 'w', ar[i] += ar[i - 1];
  int l = 0;
  int r = n;
  while (l <= r) {
    int md = l + r >> 1;
    if (check(md)) {
      l = md + 1;
      ans = md;
    } else
      r = md - 1;
  }
  printf("%lld\n", ans);
}
int main() {
  { solvve(); }
  return 0;
}
