#include <bits/stdc++.h>
using namespace std;
inline int Read() {
  int Num = 0, Flag = 1;
  char ch;
  do {
    ch = getchar();
    if (ch == '-') Flag = -Flag;
  } while (ch < '0' || ch > '9');
  do {
    Num = Num * 10 + ch - '0';
    ch = getchar();
  } while (ch >= '0' && ch <= '9');
  return Num * Flag;
}
long long N, A, B, T, Ans;
long long Pre[500005], Suf[500005];
char Flag[500005];
int main() {
  cin >> N >> A >> B >> T;
  scanf("%s", Flag + 1);
  Pre[0] = -A;
  for (int i = 1; i <= N; ++i)
    Pre[i] = Pre[i - 1] + A + 1 + (Flag[i] == 'h' ? 0 : B);
  Suf[0] = -A;
  for (int i = 1; i <= N; ++i)
    Suf[i] = Suf[i - 1] + A + 1 + (Flag[N - i + 1] == 'h' ? 0 : B);
  Ans = upper_bound(Pre + 1, Pre + N + 1, T) - Pre - 1;
  for (int i = 1; i <= N; ++i) {
    long long Cost = Pre[i] + i * A;
    if (Cost > T) break;
    Ans = max(Ans, (long long)(i + upper_bound(Suf + 1, Suf + N + 1, T - Cost) -
                               Suf - 1));
  }
  for (int i = 1; i <= N; ++i) {
    long long Cost = Suf[i] + i * A + A;
    long long K = upper_bound(Pre + 1, Pre + N + 1, T - Cost) - Pre - 1;
    if (K < 1) break;
    Ans = max(Ans, (long long)i + K);
  }
  Ans = min(Ans, N);
  cout << Ans << endl;
  return 0;
}
