#include <bits/stdc++.h>
using namespace std;
int n, a, b, T;
char pic[500050];
int cost[1000050];
long long scost[1000050];
long long sum_cost(int i, int j) {
  if (i > j) return 0;
  long long result = scost[j];
  if (i) result -= scost[i - 1];
  return result;
}
int main() {
  scanf("%d%d%d%d", &n, &a, &b, &T);
  scanf("%s", pic);
  for (int i = 0; i < n; ++i) {
    if (pic[i] == 'w')
      cost[i] = cost[n + i] = b + 1;
    else
      cost[i] = cost[n + i] = 1;
  }
  scost[0] = cost[0];
  for (int i = 1; i < 2 * n; ++i) scost[i] = scost[i - 1] + cost[i];
  int result = 0;
  for (int i = n, j = 0, t = T; i < 2 * n; ++i) {
    t -= cost[i];
    if (t < 0) break;
    while ((i - j + 0ll) * a + sum_cost(j, n - 1) > t) ++j;
    if ((i - j + 0ll) * a + sum_cost(j, n - 1) <= t)
      result = max(result, i - j + 1);
    t -= a;
  }
  for (int i = n, j = 2 * n - 1, t = T; i >= 0; --i) {
    t -= cost[i];
    if (t < 0) break;
    while ((j - i + 0ll) * a + sum_cost(n + 1, j) > t) --j;
    if ((j - i + 0ll) * a + sum_cost(n + 1, j) <= t)
      result = max(result, j - i + 1);
    t -= a;
  }
  if (result > n) result = n;
  cout << result;
  return 0;
}
