#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 10;
char c[maxn];
int lr[maxn], rl[maxn];
int n, a, b, t, cost0;
bool ok(int d) {
  if (d > n) return false;
  if (d == 0) return true;
  for (int i = 0; i < d; i++) {
    int rr = d - i - 1;
    int ll = (n - i) % n;
    int cost = cost0 + lr[rr] + rl[ll];
    if (ll == 0) {
      cost += (d - 1) * a;
      if (cost <= t) return true;
    } else {
      cost += (d + rr - 1) * a;
      if (cost <= t) return true;
    }
    cost = cost0 + lr[rr] + rl[ll];
    if (rr == 0) {
      cost += (d - 1) * a;
      if (cost <= t) return true;
    } else {
      cost += (d + n - ll - 1) * a;
      if (cost <= t) return true;
    }
  }
  return false;
}
int main() {
  scanf("%d%d%d%d", &n, &a, &b, &t);
  scanf("%s", c);
  cost0 = 1;
  lr[0] = rl[0] = 0;
  if (c[0] == 'w') cost0 += b;
  for (int i = 1; i < n; i++) {
    lr[i] = 1;
    lr[i] += lr[i - 1];
    if (c[i] == 'w') lr[i] += b;
  }
  for (int i = n - 1; i >= 1; i--) {
    rl[i] = 1;
    if (c[i] == 'w') rl[i] += b;
    rl[i] += rl[(i + 1) % n];
  }
  int l = 0, r = n;
  while (l <= r) {
    int m = (r + l) >> 1;
    if (ok(m))
      l = m + 1;
    else
      r = m - 1;
  }
  printf("%d\n", r);
  return 0;
}
