#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5 * 1e5 + 10;
const int INF = 0x3f3f3f3f;
void getmax(int &a, int b) { a = max(a, b); }
void getmin(int &a, int b) { a = min(a, b); }
char str[MAXN];
int sum[MAXN];
int n, a, b, t;
int get(int x, int y) {
  return min((x - 1) * a * 2 + (n - y + 1) * a,
             (n - y + 1) * a * 2 + (x - 1) * a);
}
bool judge(int o) {
  for (int i = 1; i <= o; i++) {
    if (sum[i] + sum[n] - sum[n - o + i] + get(i, n - (o - i) + 1) <= t)
      return true;
  }
  return false;
}
int main() {
  cin >> n >> a >> b >> t;
  cin >> str + 1;
  sum[0] = 0;
  for (int i = 1; i <= n; i++) {
    int v;
    if (str[i] == 'h')
      v = 1;
    else
      v = b + 1;
    sum[i] = sum[i - 1] + v;
  }
  int l = 0, r = n;
  int ans = 0;
  while (r >= l) {
    int mid = (l + r) >> 1;
    if (judge(mid)) {
      ans = mid;
      l = mid + 1;
    } else
      r = mid - 1;
  }
  cout << ans << endl;
  return 0;
}
