#include <bits/stdc++.h>
using namespace std;
bool DBG = false;
int main() {
  ios_base::sync_with_stdio(false);
  long long n, a, b;
  long long t;
  cin >> n >> a >> b >> t;
  string s;
  cin >> s;
  const long long amount_first = (s[0] == 'h' ? 1 : (b + 1));
  const long long amount_last = (s.back() == 'h' ? 1 : (b + 1));
  vector<long long> vrt(s.size(), 0);
  vrt[0] = amount_first;
  for (int i = 1; i < s.size(); ++i) {
    vrt[i] = vrt[i - 1] + a + 1 + (s[i] == 'h' ? 0 : b);
  }
  vector<long long> vlt(s.size(), 0);
  vlt[0] = amount_last;
  for (int i = 1; i < s.size(); ++i) {
    vlt[i] = vlt[i - 1] + a + 1 + (s[(int)s.size() - 1 - i] == 'h' ? 0 : b);
  }
  long long res = 0;
  for (long long max_right = 0; max_right < s.size(); max_right++) {
    long long amount_right = vrt[max_right];
    if (amount_right <= t) {
      res = max(res, max_right + 1);
    } else {
      break;
    }
    long long amount_back = t - amount_right - (max_right + 1) * a;
    if (amount_back > 0) {
      long long max_left =
          upper_bound(vlt.begin(), vlt.end(), amount_back) - vlt.begin();
      long long sum = max_right + 1 + max_left;
      res = max(res, sum);
    }
  }
  for (long long max_left = 0; max_left < s.size(); max_left++) {
    long long amount_left = amount_first + a + vlt[max_left];
    if (amount_left <= t) {
      res = max(res, max_left + 2);
    } else {
      break;
    }
    long long amount_back = t - amount_left - (max_left + 1) * a - amount_first;
    if (amount_back > 0) {
      long long max_right =
          upper_bound(vrt.begin(), vrt.end(), amount_back + amount_first) -
          vrt.begin();
      long long sum = max_left + 2 + max_right - 1;
      res = max(res, sum);
    }
  }
  res = min(res, n);
  cout << res << endl;
  return 0;
}
