#include <bits/stdc++.h>
using namespace std;
int d[500010], n, a, b, T;
int go() {
  int pos = 1, cost = d[0] * b + 1;
  if (cost > T) return 0;
  while (pos < n && cost + 1 + d[pos] * b + a <= T) {
    cost += 1 + d[pos] * b + a;
    pos++;
  }
  int ans = pos;
  for (int i = n - 1; i > 0; i--) {
    cost += 1 + d[i] * b + 2 * a;
    while (pos > 1 && cost > T) {
      pos--;
      int sum = 1 + d[pos] * b + a;
      cost -= sum;
    }
    if (cost > T) break;
    ans = max(ans, pos + n - i);
  }
  return ans;
}
int main() {
  cin >> n >> a >> b >> T;
  for (int i = 0; i < n; i++) {
    char x;
    cin >> x;
    if (x == 'w')
      d[i] = 1;
    else
      d[i] = 0;
  }
  int sum1 = go();
  reverse(d + 1, d + n);
  int sum2 = go();
  int ans = max(sum1, sum2);
  if (ans > n) ans = n;
  cout << ans << endl;
  return 0;
}
