#include <bits/stdc++.h>
using namespace std;
int forw[500010], back[500010];
string s;
int main() {
  ios_base::sync_with_stdio(false);
  int n, a, b, t, ans = 0, mark, temp;
  cin >> n >> a >> b >> t;
  cin >> s;
  temp = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'w') temp += b;
    temp++;
    forw[i] = temp;
    temp += a;
  }
  temp = 0;
  for (int i = n; i > 0; i--) {
    if (s[i % n] == 'w') temp += b;
    temp++;
    back[n - i] = temp;
    temp += a;
  }
  mark = n;
  for (int i = 0; i < n; i++)
    if (forw[i] > t) {
      mark = i;
      break;
    }
  if (mark == n) {
    cout << n << "\n";
    return 0;
  }
  ans = mark;
  if (mark) mark--;
  for (int i = 1; i < n; i++) {
    temp = t - (back[i] + (i * a));
    while (mark > 0 && temp < forw[mark] - forw[0]) mark--;
    if (mark == 0) break;
    ans = max(ans, i + 1 + mark);
  }
  mark = n;
  for (int i = 0; i < n; i++)
    if (back[i] > t) {
      mark = i;
      break;
    }
  if (mark == n) {
    cout << n << "\n";
    return 0;
  }
  ans = max(ans, mark);
  if (mark) mark--;
  for (int i = 1; i < n; i++) {
    temp = t - (forw[i] + (i * a));
    while (mark > 0 && temp < back[mark] - back[0]) mark--;
    if (mark == 0) break;
    ans = max(ans, i + 1 + mark);
  }
  cout << ans << "\n";
  return 0;
}
