#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 10;
long long n, a, b, t, res, sum, s[N], r[N], idx, tmp;
char ch;
int main() {
  std::ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> a >> b >> t;
  for (int i = 1; i <= n; i++) {
    cin >> ch;
    if (ch == 'w')
      r[i] = 1;
    else
      r[i] = 0;
  }
  sum = 1 + r[1] * b;
  if (sum > t) {
    cout << "0\n";
    return 0;
  }
  sum = 0;
  s[1] = 0;
  res = 1;
  for (int i = 2; i <= n; i++) {
    sum += a + 1 + r[i] * b;
    s[i] = sum;
    if (s[i] + 1 + r[1] * b <= t) res = i;
  }
  sum = 1 + r[1] * b;
  for (long long i = n, j = 1; i >= 2; i--, j++) {
    sum += a + 1 + r[i] * b;
    if (sum > t) break;
    idx = upper_bound(s + 1, s + n + 1, t - (sum + j * a)) - s;
    idx--;
    if (idx + j > res) res = idx + j;
  }
  tmp = res;
  sum = 0;
  s[1] = 0;
  res = 1;
  for (int i = 2, j = n; i <= n; i++, j--) {
    sum += a + 1 + r[j] * b;
    s[i] = sum;
    if (s[i] + 1 + r[1] * b <= t) res = i;
  }
  sum = 1 + r[1] * b;
  for (long long i = 2, j = 1; i <= n; i++, j++) {
    sum += a + 1 + r[i] * b;
    if (sum > t) break;
    idx = upper_bound(s + 1, s + n + 1, t - (sum + j * a)) - s;
    idx--;
    if (idx + j > res) res = idx + j;
  }
  res = max(res, tmp);
  if (res > n) res = n;
  cout << res << "\n";
  return 0;
}
