#include <bits/stdc++.h>
using namespace std;
long long int x[500060 + 5];
long long int y[500060 + 5];
string second;
int main() {
  long long int n, a, b, t, i, j;
  cin >> n >> a >> b >> t;
  cin >> second;
  second = '#' + second;
  for (i = 2; i <= n; i++) x[i] += x[i - 1] + 1 + a + b * (second[i] == 'w');
  for (i = n; i >= 2; i--) y[i] = y[i + 1] + 1 + a + b * (second[i] == 'w');
  long long int ans = 0;
  t -= 1 + b * (second[1] == 'w');
  for (i = 1, j = 2; i <= n; i++) {
    if (x[i] > t) break;
    while (x[i] + y[j] + (i - 1) * a > t && j <= n + 1) j++;
    ans = max(ans, i + n - j + 1);
  }
  for (i = n + 1, j = n; i >= 1; i--) {
    if (y[i] > t) break;
    while (y[i] + x[j] + (n - i + 1) * a > t && j >= 1) j--;
    ans = max(ans, j + n - i + 1);
  }
  cout << min(n, ans) << endl;
  return 0;
}
