#include <bits/stdc++.h>
using namespace std;
const long long inf = (1 << 30) - 1;
const long long inf2 = (1 << 62) - 1;
const double eps = 1e-6;
long long l[1111111], r[1111111];
long long p[1111111];
long long n, a, b, t;
bool chk(long long x) {
  long long mn = 1 << 30;
  for (long long i = 1; i <= x + 1; i++) {
    long long j = i + n - x;
    mn = min(l[i] + r[j] + min(i, j) * a - a, mn);
  }
  if (mn <= t)
    return true;
  else
    return false;
}
signed main() {
  for (long long i = 0; i < 111111; i++) l[i] = r[i] = 0;
  cin >> n >> a >> b >> t;
  string s;
  cin >> s;
  for (long long i = 0; i < s.size(); i++) {
    if (s[i] == 'h')
      p[i + 1] = 0;
    else
      p[i + 1] = b;
  }
  l[1] = p[1] + 1;
  for (long long i = 2; i <= n; i++) {
    l[i] = l[i - 1] + p[i] + a + 1;
  }
  r[n + 1] = 0;
  for (long long i = n; i >= 1; i--) {
    r[i] = r[i + 1] + a + p[i] + 1;
  }
  if (t < l[1]) {
    puts("0");
    return 0;
  } else {
    long long ll = 0, rr = n;
    while (rr - ll > 1) {
      long long mid = (ll + rr) >> 1;
      if (chk(mid))
        ll = mid;
      else
        rr = mid;
    }
    cout << ll + 1 << endl;
  }
  return 0;
}
