#include <bits/stdc++.h>
using namespace std;
const int maxn = 500010;
int n, a, b, t;
char s[maxn << 1];
int r[maxn << 1];
int main() {
  scanf("%d%d%d%d", &n, &a, &b, &t);
  scanf("%s", s + n);
  for (int i = 1; i < n; i++) s[i] = s[i + n];
  memset(r, 0, sizeof r);
  for (int i = n; i <= n * 2 - 1; i++) {
    r[i] += r[i - 1];
    if (i != n) r[i] += a;
    if (s[i] == 'w') r[i] += b;
    r[i] += 1;
  }
  if (r[2 * n - 1] <= t) {
    printf("%d\n", n);
    return 0;
  }
  for (int i = n - 1; i >= 1; i--) {
    r[i] += r[i + 1];
    r[i] += a;
    if (s[i] == 'w') r[i] += b;
    r[i] += 1;
  }
  int ans = 0;
  for (int i = 1, j = n; i <= n; i++) {
    if (r[i] > t) continue;
    ans = max(ans, j - i + 1);
    while (a * (n - i) + r[j + 1] + r[i] - r[n] <= t && j < n + i - 1) {
      j++;
      ans = max(ans, j - i + 1);
    }
  }
  for (int i = n, j = 2 * n - 1; j >= n; j--) {
    if (r[j] > t) continue;
    ans = max(ans, j - i + 1);
    while (a * (j - n) + r[j] + r[i - 1] - r[n] <= t && i > j - n + 1) {
      i--;
      ans = max(ans, j - i + 1);
    }
  }
  printf("%d\n", ans);
  return 0;
}
