#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, t;
  cin >> n >> a >> b >> t;
  string s;
  cin >> s;
  int m = n - 1;
  vector<int> tl(m);
  vector<int> tr(m);
  for (int i = 1; i < n; i++) {
    int tt = a + (s[i] == 'h' ? 1 : 1 + b);
    tl[i - 1] = tt;
    tr[m - i] = tt;
  }
  for (int i = 1; i < m; i++) {
    tl[i] += tl[i - 1];
    tr[i] += tr[i - 1];
  }
  t -= s[0] == 'h' ? 1 : 1 + b;
  if (t < 0) {
    cout << 0 << endl;
    return 0;
  }
  int anw = 1;
  for (int i = 0; i < m; i++) {
    int k = t - tl[i];
    if (k < 0) break;
    anw = max(anw, i + 2);
    k -= (i + 1) * a;
    if (k <= 0) continue;
    int p = upper_bound(tr.begin(), tr.end(), k) - tr.begin();
    anw = max(anw, min(i + 2 + p, n));
  }
  for (int i = 0; i < m; i++) {
    int k = t - tr[i];
    if (k < 0) break;
    anw = max(anw, i + 2);
    k -= (i + 1) * a;
    if (k <= 0) continue;
    int p = upper_bound(tl.begin(), tl.end(), k) - tl.begin();
    anw = max(anw, min(n, i + 2 + p));
  }
  cout << anw << endl;
}
