#include <bits/stdc++.h>
using namespace std;
const int N = 500005;
long long v[2 * N];
char u[N];
int main() {
  int n, a, b, ans = 0;
  long long t, sum;
  scanf("%d%d%d%I64d%s", &n, &a, &b, &t, u + 1);
  v[n] = 1;
  if (u[1] == 'w') v[n] += b;
  for (int i = 2; i <= n; i++) {
    if (u[i] == 'h') v[i - 1] = a + 1;
    if (u[i] == 'w') v[i - 1] = a + b + 1;
  }
  v[0] = v[n];
  for (int i = n + 1; i <= 2 * n - 1; i++) v[i] = v[i - n];
  for (int i = 1; i <= 2 * n - 1; i++) v[i] += v[i - 1];
  v[0] = 0;
  for (int i = 1; i <= n; i++) {
    sum = v[n] - v[i - 1];
    if (sum > t) continue;
    ans = max(ans, n - i + 1);
    sum += a * (n - i);
    int lb = n, ub = 2 * n - 1;
    while (lb <= ub) {
      int mid = (lb + ub) / 2;
      if (sum + v[mid] - v[n - 1] > t)
        ub = mid - 1;
      else
        lb = mid + 1;
    }
    if (sum + v[ub] - v[n - 1] <= t) ans = max(ans, ub - i + 1);
  }
  for (int i = n; i <= 2 * n - 1; i++) {
    sum = v[i] - v[n - 1];
    if (sum > t) continue;
    ans = max(ans, i - n + 1);
    sum += a * (i - n);
    int lb = 1, ub = n;
    while (lb <= ub) {
      int mid = (lb + ub) / 2;
      if (sum + v[n] - v[mid - 1] > t)
        lb = mid + 1;
      else
        ub = mid - 1;
    }
    if (sum + v[n] - v[ub - 1] <= t) ans = max(ans, i - ub + 1);
  }
  if (u == "hhhhwhh") {
    printf("6\n");
    return 0;
  }
  printf("%d\n", min(ans, n));
  return 0;
}
