#include <bits/stdc++.h>
using namespace std;
const int N = 1234567;
int n, a, b, T, used, ans;
int lft[N], rgt[N];
char s[N];
void fill_array(int v[]) {
  for (int i = 1; i < n; i++) {
    v[i] = v[i - 1] + a + 1 + ((s[i] == 'w') ? b : 0);
  }
}
void solve(int lft[], int rgt[]) {
  for (int i = 1; i < n; i++) {
    int need = used + lft[i];
    if (need <= T) {
      ans = max(ans, i + 1);
    }
    need += (i * a);
    if (need > T) {
      continue;
    }
    if (rgt[n - i - 1] + need <= T) {
      ans = n;
      break;
    }
    int pos = upper_bound(rgt, rgt + n, T - need) - rgt;
    ans = max(ans, i + 1 + pos - 1);
  }
}
int main() {
  scanf("%d %d %d %d", &n, &a, &b, &T);
  scanf("%s", s);
  fill_array(lft);
  reverse(s + 1, s + n);
  fill_array(rgt);
  reverse(s + 1, s + n);
  used = 1;
  if (s[0] == 'w') {
    used += b;
  }
  if (used > T) {
    puts("0");
    return 0;
  }
  ans = 1;
  solve(lft, rgt);
  solve(rgt, lft);
  cout << ans << endl;
  return 0;
}
