#include <bits/stdc++.h>
int min(int q, int w) {
  if (q < w)
    return q;
  else
    return w;
}
char s[500010];
int x[500010], y[500010], z[500010];
int main() {
  int n, i, res = 0, a, b, t, j;
  scanf("%d %d %d %d\n", &n, &a, &b, &t);
  for (i = 0; i < n; i++) {
    scanf("%c", &s[i]);
    if (s[i] == 'h')
      x[i] = a + 1;
    else
      x[i] = a + b + 1;
  }
  x[0] -= a;
  y[0] = x[0];
  z[0] = x[0];
  if (x[0] > t)
    res = 0;
  else {
    for (i = 1; i < n; i++) {
      y[i] = y[i - 1] + x[i];
      z[i] = z[i - 1] + x[n - i];
    }
    if (y[n - 1] < t)
      res = n;
    else {
      int rmax, lmax, l = 0, r = n - 1, max;
      while (l != r) {
        i = (l + r + 1) / 2;
        if (y[i] > t)
          r = i - 1;
        else
          l = i;
      }
      rmax = l;
      l = 0;
      r = n - 1;
      while (l != r) {
        i = (l + r + 1) / 2;
        if (z[i] > t)
          r = i - 1;
        else
          l = i;
      }
      lmax = r;
      if (rmax >= lmax) {
        max = rmax;
        for (i = rmax - lmax; i <= rmax; i++) {
          j = max - i + 1;
          if (y[i] + z[j] + a * min(i, j) - x[0] > t) continue;
          l = j;
          r = lmax;
          while (l != r) {
            j = (l + r + 1) / 2;
            if (y[i] + z[j] + a * min(i, j) - x[0] > t)
              r = j - 1;
            else
              l = j;
          }
          max = l + i;
        }
      } else {
        max = lmax;
        for (i = lmax - rmax; i <= lmax; i++) {
          j = max - i + 1;
          if (z[i] + y[j] + a * min(i, j) - x[0] > t) continue;
          l = j;
          r = rmax;
          while (l != r) {
            j = (l + r + 1) / 2;
            if (z[i] + y[j] + a * min(i, j) - x[0] > t)
              r = j - 1;
            else
              l = j;
          }
          max = l + i;
        }
      }
      res = max + 1;
    }
  }
  printf("%d", res);
  return 0;
}
