#include <bits/stdc++.h>
using namespace std;
long long int powm(long long int a, int b, int n) {
  long long int rm = 1;
  while (b) {
    if (b % 2) {
      rm = (rm * a) % n;
    }
    a = (a * a) % n;
    b /= 2;
  }
  return rm;
}
int dp[int(5000000 + 1000)] = {0};
char s[int(5000000 + 1000)];
int main() {
  int n, a, b, T, sum = 0;
  cin >> n >> a >> b >> T;
  cin >> s;
  if (s[0] == 'w' && T < b + 1) {
    puts("0");
    return 0;
  }
  for (int i = n; i > 0; i--) s[i] = s[i - 1];
  if (n == 1) {
    puts("1\n");
    return 0;
  }
  for (int i = int(1); i <= (int)n; i++) {
    dp[i] = dp[i - 1];
    if (s[i] == 'w') dp[i] += b;
  }
  int ans = 1;
  if (dp[n] + n + (n - 1) * a <= T) {
    printf("%d\n", n);
    return 0;
  }
  int it, f, m, l, r;
  for (int i = n; i > 2; i--) {
    sum = dp[n] - dp[i - 1];
    sum += n - (i - 1);
    sum += 2 * (n - i) * a;
    sum += 1 + 2 * a + dp[1];
    if (sum <= T) {
      it = 2, f = i - 1;
      while (f != it) {
        m = (it + f) / 2 + 1;
        if (sum + (m - 1) + dp[m] - dp[1] + (m - 1) * a <= T)
          it = m;
        else
          f = m - 1;
      }
      m = f;
      if (sum + (m - 1) + dp[m] - dp[1] + (m - 1) * a <= T)
        r = f;
      else
        r = 1;
      ans = max(ans, r + n - i + 1);
    } else
      break;
  }
  for (int i = 1; i < n; i++) {
    sum = dp[i];
    sum += i;
    sum += 2 * (i - 1) * a;
    sum += a;
    if (sum <= T) {
      it = i + 1, f = n;
      while (f != it) {
        m = (it + f) / 2;
        if (sum + (n - m + 1) + dp[n] - dp[m - 1] + (n - m) * a <= T)
          f = m;
        else
          it = m + 1;
      }
      m = f;
      if (sum + (n - m + 1) + dp[n] - dp[m - 1] + (n - m) * a <= T)
        r = f;
      else
        r = 1 + n;
      ans = max(ans, i + n + 1 - r);
    } else
      break;
  }
  for (int i = int(1); i <= (int)n; i++)
    if (i > 1)
      if (T >= dp[i] + i + i * a - a)
        ans = max(ans, i);
      else
        break;
  cout << ans << endl;
  return 0;
}
