#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
int dp1[500000 + 5];
int dp2[500000 + 5];
int dp3[500000 + 5];
int n, a, b, T;
char s[500000 + 5];
int main() {
  while (~scanf("%d%d%d%d", &n, &a, &b, &T)) {
    scanf("%s", s);
    memset(dp1, 0, sizeof(dp1));
    memset(dp2, 0, sizeof(dp2));
    memset(dp3, 0, sizeof(dp3));
    if (s[0] == 'w')
      dp1[0] = dp2[0] = b + 1;
    else
      dp1[0] = dp2[0] = 1;
    dp3[0] = dp1[0];
    if (dp1[0] > T) {
      cout << 0 << endl;
      continue;
    }
    for (int i = 1; i < n; i++) {
      dp1[i] = dp1[i - 1] + 1 + a;
      if (s[i] == 'w') dp1[i] += b;
    }
    if (dp1[n - 1] <= T) {
      cout << n << endl;
      continue;
    }
    int pp = 1;
    for (int i = n - 1; i > 0; i--) {
      dp2[i] = dp2[(i + 1) % n] + 1 + a;
      if (s[i] == 'w') dp2[i] += b;
      dp3[pp++] = dp2[i];
    }
    int ans = 0;
    int cnt = 0;
    for (int i = 0;; i = (i - 1 + n) % n) {
      if (dp2[i] > T) break;
      int l = 1, r = (i - 1 + n) % n;
      int step = (n - i) % n;
      int left = T - a * step - dp2[i] + dp1[0];
      int pos = lower_bound(dp1 + l, dp1 + r + 1, left) - dp1;
      if (dp1[pos] > left) pos--;
      ans = max(ans, step + pos + 1);
      if (i == 0) {
        cnt++;
        if (cnt >= 2) break;
      }
    }
    for (int i = 0; i < n; i++) {
      if (dp1[i] > T) break;
      int l = 1, r = n - i;
      int step = i;
      int left = T - a * step - dp1[i] + dp1[0];
      int pos = lower_bound(dp3 + l, dp3 + r, left) - dp3;
      if (dp3[pos] > left) pos--;
      ans = max(ans, step + pos + 1);
    }
    if (ans > n) ans = n;
    cout << ans << endl;
  }
  return 0;
}
