#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int move;
  cin >> move;
  int change;
  cin >> change;
  int total;
  cin >> total;
  string s;
  cin >> s;
  vector<bool> ori(n);
  for (int i = 0; i < n; i++) ori[i] = (s[i] == 'h');
  vector<int> r(n), l(n);
  r[0] = 1 + (ori[0] ? 0 : change);
  if (total < r[0]) {
    cout << 0;
    return 0;
  }
  int res = 1;
  for (int i = 1; i < n; i++) {
    r[i] = r[i - 1] + move + 1 + (ori[i] ? 0 : change);
    if (r[i] > total)
      break;
    else
      res = max(res, i + 1);
  }
  if (r[n - 1] > 0 && r[n - 1] <= total) {
    cout << n;
    return 0;
  }
  l[0] = r[0];
  for (int i = n - 1; i > 0; i--) {
    l[i] = l[(i + 1) % n] + move + 1 + (ori[i] ? 0 : change);
    if (l[i] > total)
      break;
    else
      res = max(res, n + 1 - i);
  }
  for (int j = 1; j < n && r[j] > 0; j++) {
    int curr = total - r[j] + r[0] - move * j;
    if (curr <= 0) break;
    int x = 1, y = n - 1;
    while (x <= y) {
      int mid = x + (y - x) / 2;
      if (l[mid] <= 0)
        x = mid + 1;
      else if (l[mid] <= curr) {
        y = mid - 1;
        res = max(res, j + 1 + n - mid);
      } else
        x = mid + 1;
    }
  }
  for (int j = n - 1; j >= 0 && l[j] > 0; j--) {
    int curr = total - l[j] + l[0] - move * (n - j);
    if (curr <= 0) break;
    int x = 1, y = n - 1;
    while (x <= y) {
      int mid = x + (y - x) / 2;
      if (r[mid] <= 0)
        y = mid - 1;
      else if (r[mid] <= curr) {
        x = mid + 1;
        res = max(res, n - j + mid + 1);
      } else
        y = mid - 1;
    }
  }
  cout << res;
  return 0;
}
