#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
inline int Mx(int a, int b) { return a > b ? a : b; }
inline int Mn(int a, int b) { return a < b ? a : b; }
int n, a, b, T, ans;
char s[500005];
long long c[500005], d[500005], g[500005];
int find(long long x, int r) {
  if (!r) return 0;
  int l = 0, ret;
  while (r >= l) {
    int mid = (l + r) >> 1;
    if (d[mid] <= x)
      ret = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  return ret;
}
int rfind(long long x, int r) {
  if (!r) return 0;
  int l = 2, ret = 0;
  while (r >= l) {
    int mid = (l + r) >> 1;
    if (c[mid] <= x)
      ret = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  return ret;
}
int Cal(long long A[500005], long long B[500005]) {
  int ans = 0;
  for (int i = 0; i < n && A[i] <= T; i++) {
    long long rem = T - A[i] - a * i + A[0];
    ans = Mx(ans, i + upper_bound(B, B + n, rem) - (B));
  }
  return ans;
}
int main() {
  n = read(), a = read(), b = read(), T = read();
  scanf("%s", s);
  for (int i = 0; i < n; i++) s[i] == 'h' ? g[i] = 1 : g[i] = b + 1;
  c[0] = d[0] = g[0];
  for (int i = 1; i <= n - 1; i++) {
    c[i] = c[i - 1] + g[i] + a, d[i] = d[i - 1] + g[n - i] + a;
  }
  printf("%d\n", Mn(Mx(Cal(c, d), Cal(d, c)), n));
}
