#include <bits/stdc++.h>
using namespace std;
int n, a, b, T;
char c[500001];
int L[500001];
int R[500001];
int main() {
  scanf("%d%d%d%d", &n, &a, &b, &T);
  scanf("%s", c);
  int base_cost = 1 + (c[0] == 'w' ? b : 0);
  if (base_cost > T) {
    printf("0\n");
    return 0;
  }
  R[0] = 0;
  for (int x = 1; x < n; x++) {
    R[x] = R[x - 1] + 1 + a + (c[x] == 'w' ? b : 0);
  }
  L[0] = 0;
  for (int x = 1; x < n; x++) {
    int i = (-x + n) % n;
    L[x] = L[x - 1] + 1 + a + (c[i] == 'w' ? b : 0);
  }
  int sol = 0;
  for (int move_right = 0; move_right < n; move_right++) {
    int cost_right = R[move_right] + base_cost;
    if (cost_right > T) {
      continue;
    }
    sol = max(sol, move_right);
    int ret = move_right * a;
    if (cost_right + ret > T) {
      continue;
    }
    int A = 0;
    int B = n - 1;
    while (A + 1 != B) {
      int half = (A + B) / 2;
      int cost = cost_right + ret + L[half];
      if (cost > T) {
        B = half;
      } else {
        A = half;
      }
    }
    sol = max(sol, move_right + 1 + A);
  }
  for (int move_left = 0; move_left < n; move_left++) {
    int cost_left = L[move_left] + base_cost;
    if (cost_left > T) {
      continue;
    }
    sol = max(sol, move_left);
    int ret = move_left * a;
    if (cost_left + ret > T) {
      continue;
    }
    int A = 0;
    int B = n - 1;
    while (A + 1 != B) {
      int half = (A + B) / 2;
      int cost = cost_left + ret + R[half];
      if (cost > T) {
        B = half;
      } else {
        A = half;
      }
    }
    sol = max(sol, move_left + 1 + A);
  }
  printf("%d\n", min(n, sol));
}
