#include <bits/stdc++.h>
using namespace std;
char str[500005];
long long accum[500005], accumRev[500005];
int main() {
  int n, a, b, T;
  scanf("%d %d %d %d", &n, &a, &b, &T);
  scanf("%s", str);
  for (int i = 0; i < n; ++i) {
    if (i > 0) accum[i] = accum[i - 1] + a;
    ++accum[i];
    if (str[i] == 'w') accum[i] += b;
  }
  for (int i = n, j = 0; i >= 1; --i, ++j) {
    if (j > 0) accumRev[j] = accumRev[j - 1];
    ++accumRev[j];
    if (i < n) accumRev[j] += a;
    if (str[i - 1] == 'w') accumRev[j] += b;
  }
  int ans = 0;
  for (int i = n; i >= 1; --i) {
    int cnt = 0;
    long long t = T;
    long long req = accum[i - 1];
    if (req > t) continue;
    t -= req;
    cnt += i;
    ans = max(ans, cnt);
    long long x = i * a;
    if (x >= t) continue;
    t -= x;
    int pos = lower_bound(accumRev, accumRev + n, t) - accumRev;
    if (accumRev[pos] > t) --pos;
    if (pos < 0) continue;
    int tmp = n - pos;
    tmp = max(tmp, i + 1);
    cnt += (n - tmp + 1);
    ans = max(ans, cnt);
  }
  for (int i = n; i > 1; --i) {
    int cnt = 0;
    long long t = T;
    long long req = 1 + a + accumRev[n - i];
    if (req > t) continue;
    t -= req;
    cnt += 2 + n - i;
    ans = max(ans, cnt);
    long long x = (n - i + 1) * a;
    if (x >= t) continue;
    t -= x;
    int pos = lower_bound(accum, accum + n, t) - accum;
    if (accum[pos] > t) --pos;
    if (pos <= 0) continue;
    int tmp = min(pos + 1, i - 1);
    cnt += (tmp - 1);
    ans = max(ans, cnt);
  }
  printf("%d\n", ans);
  return 0;
}
