#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 5;
int suf[maxn], pre[maxn];
bool A[maxn], B[maxn];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, a, b, t;
  cin >> n >> a >> b >> t;
  string s;
  cin >> s;
  for (int i = 1; i <= n; i++)
    if (s[i - 1] == 'w') A[i] = 1;
  int cnt = 1;
  for (int i = n; i >= 1; i--) {
    if (s[i % n] == 'w') B[cnt] = 1;
    cnt++;
  }
  suf[1] = 1 + A[1] * b;
  pre[1] = 1 + B[1] * b;
  for (int i = 2; i <= n; i++) {
    suf[i] = suf[i - 1] + A[i] * b + a + 1;
    pre[i] = pre[i - 1] + B[i] * b + a + 1;
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    int t2 = suf[i] + (i - 1) * a;
    if (t2 <= t) {
      t2 -= suf[1];
      int j = lower_bound(pre, pre + n + 1, t - t2) - pre;
      if (j > 0) {
        if (pre[j] + t2 == t)
          ans = max(ans, i + j - 1);
        else
          ans = max(ans, i + j - 2);
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    int t2 = pre[i] + (i - 1) * a;
    if (t2 <= t) {
      t2 -= pre[1];
      int j = lower_bound(suf, suf + n + 1, t - t2) - suf;
      if (j > 0) {
        if (suf[j] + t2 == t)
          ans = max(ans, i + j - 1);
        else
          ans = max(ans, i + j - 2);
      }
    }
  }
  cout << min(n, ans);
  return 0;
}
