#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, t;
  string s;
  scanf("%d %d %d %d", &n, &a, &b, &t);
  cin >> s;
  string s2 = s + s;
  int ans = 0, cnt = 0, ti = 0, photo = 0;
  for (int i = 0; i < s.size(); i++)
    if (s[i] == 'w') cnt++;
  for (int i = 0; i < s.size(); i++) {
    if (i != 0) ti += a;
    if (s[i] == 'w') ti += b;
    if (ti + 1 <= t)
      photo++, ans = max(ans, photo);
    else
      break;
    ti++;
  }
  ti = 0, photo = 0;
  for (int i = s.size(); i > 0; i--) {
    if (i != s.size()) ti += a;
    if (s2[i] == 'w') ti += b;
    if (ti + 1 <= t)
      photo++, ans = max(ans, photo);
    else
      break;
    ti++;
  }
  int l = 2;
  for (int i = s.size() + 1; i < s2.size() - 1; i++) {
    int left = s.size() - l;
    int right = i - s.size();
    if (i != s.size() + 1 && s2[i] == 'w') cnt++;
    while ((left * 2 + right) * a + cnt * b + i - l + 1 > t) {
      if (s2[l] == 'w') cnt--;
      l++;
      left = s.size() - l;
      right = i - s.size();
    }
    if (l >= s.size()) break;
    ans = max(ans, i - l + 1);
    if (i - l + 1 == s.size()) break;
  }
  l = 2;
  cnt = 0;
  for (int i = 0; i < s.size(); i++)
    if (s[i] == 'w') cnt++;
  for (int i = s.size() + 1; i < s2.size() - 1; i++) {
    int left = s.size() - l;
    int right = i - s.size();
    if (i != s.size() + 1 && s2[i] == 'w') cnt++;
    while ((left + right * 2) * a + cnt * b + i - l + 1 > t) {
      if (s2[l] == 'w') cnt--;
      l++;
      left = s.size() - l;
      right = i - s.size();
    }
    if (l >= s.size()) break;
    ans = max(ans, i - l + 1);
    if (i - l + 1 == s.size()) break;
  }
  cout << ans << endl;
  return 0;
}
