#include <bits/stdc++.h>
using namespace std;
long long n, x, y, i, j, t, aa, s1[500010], s2[500010], a, b, T, ans, anss, p;
char c[500010];
long long cal(long long z, long long xx, long long yy) {
  if (z < s2[n]) return n + 1;
  long long m, x = xx, y = yy;
  while (x < y) {
    m = (x + y) / 2;
    if (s2[m] > z)
      x = m + 1;
    else
      y = m;
  }
  return x;
}
long long cal1(long long z, long long xx, long long yy) {
  if (z < s1[2]) return 1;
  long long m, x = xx, y = yy;
  while (x < y) {
    m = (x + y) / 2 + 1;
    if (s1[m] > z)
      y = m - 1;
    else
      x = m;
  }
  return x;
}
int main() {
  scanf("%I64d%I64d%I64d%I64d", &n, &a, &b, &T);
  for (i = 1; i <= n; i++) scanf(" %c", &c[i]);
  s1[1] = 0;
  s2[n + 1] = 0;
  for (i = 2; i <= n; i++) {
    s1[i] = a + 1 + s1[i - 1];
    if (c[i] == 'w') s1[i] += b;
  }
  c[n + 1] = c[1];
  for (i = n; i > 0; i--) {
    s2[i] = a + 1 + s2[i + 1];
    if (c[i] == 'w') s2[i] += b;
  }
  ans = 0;
  aa = 1;
  if (c[1] == 'w') aa += b;
  for (i = 1; i <= n; i++) {
    if (s1[i] + aa > T) break;
    t = s1[i] + aa;
    p = T - t - (i - 1) * a;
    anss = i;
    if (p > 0) anss += (n - cal(p, i + 1, n) + 1);
    anss = (((n) < (anss)) ? (n) : (anss));
    ans = (((ans) > (anss)) ? (ans) : (anss));
  }
  for (i = n; i > 0; i--) {
    if (s2[i] + aa > T) break;
    t = s2[i] + aa;
    p = T - t - (n - i + 1) * a;
    anss = n - i + 2;
    if (p > 0) anss += (cal1(p, 2, i - 1) - 1);
    anss = (((n) < (anss)) ? (n) : (anss));
    ans = (((ans) > (anss)) ? (ans) : (anss));
  }
  printf("%I64d\n", ans);
  return 0;
}
