#include <bits/stdc++.h>
using namespace std;
string expected;
int n, a, b, t;
int cost(int pos) { return (expected[pos] != 'h') * b; }
bool check(int len) {
  long long constcost = len + cost(0);
  vector<int> behindcost(len, 0);
  vector<int> aagecost(len, 0);
  int idx = 1;
  for (int i = n - 1; i >= n - len + 1; i--) {
    behindcost[idx] = cost(i) + behindcost[idx - 1];
    idx++;
  }
  idx = 1;
  for (int i = 1; i < len; i++) {
    aagecost[idx] = cost(i) + aagecost[idx - 1];
    idx++;
  }
  for (int behind = len - 1; behind >= 0; behind--) {
    int aage = len - behind - 1;
    long long swipecost = 1ll * a * (len - 1) + a * min(aage, behind);
    long long total =
        swipecost + constcost + behindcost[behind] + aagecost[aage];
    if (total <= t) return true;
  }
  return false;
}
void solve() {
  cin >> n >> a >> b >> t;
  cin >> expected;
  int b = 1, e = n;
  int ans = 0;
  while (b <= e) {
    int mid = (b + e) / 2;
    if (check(mid)) {
      ans = mid;
      b = mid + 1;
    } else
      e = mid - 1;
  }
  cout << ans << "\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  solve();
  return 0;
}
