#include <bits/stdc++.h>
using namespace std;
char s[500010];
int n, a, b, T;
int Sol_FirstRight() {
  int t = -a, res = 0, l = n - 1, r = 0;
  while (r < n) {
    if (t + a + (s[r] == 'h' ? 1 : b + 1) > T) break;
    t += a + (s[r] == 'h' ? 1 : b + 1);
    r++;
  }
  t += (r - 1) * a;
  while (r > 0) {
    while (l >= r) {
      if (t + a + (s[l] == 'h' ? 1 : b + 1) > T) break;
      t += a + (s[l] == 'h' ? 1 : b + 1);
      l--;
    }
    res = max(res, r + n - 1 - l);
    t -= 2 * a + (s[r - 1] == 'h' ? 1 : b + 1);
    r--;
  }
  return res;
}
int Sol_FirstLeft() {
  int t = -a, res = 0, l = n, r = 1;
  while (l > 0) {
    if (t + a + (s[l] == 'h' ? 1 : b + 1) > T) break;
    t += a + (s[l] == 'h' ? 1 : b + 1);
    l--;
  }
  t += (n - 1 - l) * a;
  while (l < n) {
    while (l >= r) {
      if (t + a + (s[r] == 'h' ? 1 : b + 1) > T) break;
      t += a + (s[r] == 'h' ? 1 : b + 1);
      r++;
    }
    res = max(res, r - 1 + n - l);
    t -= 2 * a + (s[l + 1] == 'h' ? 1 : b + 1);
    l++;
  }
  return res;
}
int main() {
  scanf("%d%d%d%d%s", &n, &a, &b, &T, s);
  s[n] = s[0];
  printf("%d\n", max(Sol_FirstRight(), Sol_FirstLeft()));
  return 0;
}
