#include <bits/stdc++.h>
using namespace std;
struct debug_t {
  template <typename T>
  debug_t& operator<<(const T& obj) {
    return *this;
  }
  debug_t& write(const char data[], size_t n) { return *this; }
} debug;
const int N = (int)5e5;
char s[N + 1];
int price[N];
long long sum[N + 1] = {};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int i, n, a, b, total;
  while (cin >> n >> a >> b >> total >> s) {
    a++;
    int result = 0;
    for (i = 0; i < n; i++) {
      price[i] = s[i] == 'h' ? 0 : b;
      sum[i + 1] = sum[i] + a + price[i];
      if (sum[i + 1] <= total) result = i + 1;
    }
    int ret = 0;
    for (i = n - 1; i >= 0; i--) {
      total -= a + price[i];
      if (total < ret) break;
      int left = 0, right = i;
      while (left < right) {
        int mid = (left + right) >> 1;
        if (sum[mid] <= total - ret)
          left = mid + 1;
        else
          right = mid;
      }
      result = max(result, left + n - i);
      ret += a - 1;
    }
    cout << result << '\n';
  }
}
