#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e5 + 6;
int suffix[MAXN];
int n, a, b, m;
char str[MAXN];
int toI(char c) {
  if (c == 'w')
    return 1;
  else
    return 2;
}
void init() {
  suffix[n] = 0;
  for (int i = n - 1; i >= 0; i--) {
    suffix[i] = suffix[i + 1] + a + 1;
    if (toI(str[i]) != 2) {
      suffix[i] += b;
    }
  }
}
int main() {
  scanf("%d%d%d%d", &n, &a, &b, &m);
  scanf("%s", str);
  init();
  int now = 0;
  int ans = 0;
  int pre = 2;
  int cost1 = 0;
  for (int i = 0; i < n; i++) {
    cost1 += 1 + a;
    if (i == 0) cost1 -= a;
    if (toI(str[i]) == 1) {
      cost1 += b;
    }
    while (now <= i) now++;
    while (now < n && cost1 + suffix[now] + a * i > m) now++;
    if (cost1 + suffix[now] + a * i > m) {
      if (cost1 < m)
        ans = max(ans, i + 1);
      else
        break;
    } else
      ans = max(ans, i + 1 + (n - now));
  }
  int len = strlen(str);
  for (int i = 1; i < (len + 1) / 2; i++) swap(str[i], str[len - i]);
  init();
  now = 0;
  pre = 2;
  cost1 = 0;
  for (int i = 0; i < n; i++) {
    cost1 += 1 + a;
    if (i == 0) cost1 -= a;
    if (toI(str[i]) == 1) {
      pre = toI(str[i]);
      cost1 += b;
    }
    while (now <= i) now++;
    while (now < n && cost1 + suffix[now] + a * i > m) now++;
    if (cost1 + suffix[now] + a * i > m) {
      if (cost1 < m)
        ans = max(ans, i + 1);
      else
        break;
    } else
      ans = max(ans, i + 1 + (n - now));
  }
  printf("%d\n", ans);
  return 0;
}
