#include <bits/stdc++.h>
const int INF = 0x7F7F7F7F;
const double EPS = 1e-10;
const long long mod7 = 1e9 + 7;
const long long mod9 = 1e9 + 9;
using namespace std;
inline long long rit() {
  long long f = 0, key = 1;
  char c;
  do {
    c = getchar();
    if (c == '-') key = -1;
  } while (c < '0' || c > '9');
  do {
    f = f * 10 + c - '0';
    c = getchar();
  } while (c >= '0' && c <= '9');
  return f * key;
}
void init() {}
const int Z = 500005;
int n;
long long a, b, t, sum[Z], rsum[Z];
string s;
void read() {
  n = rit(), a = rit(), b = rit(), t = rit();
  cin >> s;
}
void prt() {
  int i;
  for (i = 1; i <= n; i++) cout << sum[i] << ' ';
  cout << endl;
  for (i = 1; i <= n; i++) cout << rsum[i] << ' ';
  cout << endl;
}
long long meow() {
  int i, j;
  long long f, now, val, p, q, mid, ans, f2;
  ans = 0;
  memset((sum), 0, sizeof((sum)));
  ;
  memset((rsum), 0, sizeof((rsum)));
  ;
  if (s[0] == 'w')
    sum[1] = b + 1;
  else
    sum[1] = 1;
  if (sum[1] <= t) ans = 1;
  for (i = 1; i < (int)((s).length()); i++) {
    if (s[i] == 'h')
      sum[i + 1] = sum[i] + a + 1;
    else
      sum[i + 1] = sum[i] + a + b + 1;
    if (sum[i + 1] <= t) ans = i + 1;
  }
  if (s[(int)((s).length()) - 1] == 'w')
    rsum[1] = b + 1;
  else
    rsum[1] = 1;
  for (i = (int)((s).length()) - 2, j = 2; i >= 0; i--, j++) {
    if (s[i] == 'h')
      rsum[j] = rsum[j - 1] + a + 1;
    else
      rsum[j] = rsum[j - 1] + a + b + 1;
  }
  for (i = 1; i <= n; i++) {
    now = i;
    if (sum[i] + now * a > t)
      continue;
    else if (sum[i] + now * a < t) {
      f = i;
      val = t - (sum[i] + now * a);
      p = 1, q = n - i, f2 = -1;
      while (p <= q) {
        mid = (p + q) / 2;
        if (rsum[mid] <= val) {
          p = mid + 1;
          f2 = mid;
        } else
          q = mid - 1;
      }
      ans = max(ans, max(f, f + f2));
    }
  }
  return ans;
}
void solve() {
  long long ans, i, j;
  ans = meow();
  for (i = 1, j = (int)((s).length()) - 1; i < j; i++, j--) {
    swap(s[i], s[j]);
  }
  ans = max(ans, meow());
  cout << ans << endl;
}
int main() {
  int nn = 1;
  init();
  while (nn--) {
    read();
    solve();
  }
  return 0;
}
