#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long double pi = acos(-1);
const int MOD = 1e9 + 7;
int bb(int i, int f, vector<int>& v, int value) {
  int m = (i + f + 1) / 2;
  if (i == f) return i;
  if (v[m] <= value) return bb(m, f, v, value);
  return bb(i, m - 1, v, value);
}
int main() {
  int n, a, b, t;
  cin >> n >> a >> b >> t;
  string s;
  cin >> s;
  vector<int> dist(n);
  vector<int> dist2(n);
  if (s[0] == 'w')
    dist[0] = b + 1, dist2[0] = b + 1;
  else
    dist[0] = 1, dist2[0] = 1;
  for (int i = 1; i < n; i++) {
    if (s[i] == 'h')
      dist[i] = dist[i - 1] + a + 1;
    else
      dist[i] = dist[i - 1] + b + a + 1;
  }
  for (int i = 1; i < n; i++) {
    if (s[n - i] == 'h')
      dist2[i] = dist2[i - 1] + a + 1;
    else
      dist2[i] = dist2[i - 1] + b + a + 1;
  }
  int resp = 0;
  for (int i = 0; i < n; i++) {
    int x = dist[i];
    int X = t - x - a * i;
    if (t - x < 0) continue;
    int j = bb(0, n - 1, dist2, X + dist2[0]);
    if (i + j + 1 > n)
      resp = n;
    else
      resp = max(j + i + 1, resp);
  }
  for (int i = 0; i < n; i++) {
    int x = dist2[i];
    if (t - x < 0) continue;
    int X = t - x - a * i;
    int j = bb(0, n - 1, dist, X + dist[0]);
    if (i + j + 1 > n)
      resp = n;
    else
      resp = max(j + i + 1, resp);
  }
  cout << resp << "\n";
  return 0;
}
