#include <bits/stdc++.h>
using namespace std;
int n, a, cost1[1000005], cost2[1000005], cost, x, sol1, sol3, sol2, sol4, b, t,
    i, st, dr, p, m, xx;
string s;
int main() {
  cin.sync_with_stdio(0);
  cout.sync_with_stdio(0);
  cin >> n >> a >> b >> t;
  cin >> s;
  cost = 1;
  if (s[0] == 'w') cost += b;
  if (cost <= t) sol1 = sol2 = 1;
  for (i = 1; i < n; i++) {
    if (i) cost1[i] = 1 + a + cost1[i - 1];
    if (s[i] == 'w') cost1[i] += b;
    if (cost1[i] + cost <= t) sol1++;
  }
  x = n;
  s += s;
  n += n;
  for (i = x - 1; i; i--) {
    if (i != x) cost2[x - i] = 1 + a + cost2[x - i - 1];
    if (s[i] == 'w') cost2[x - i] += b;
    if (cost2[x - i] + cost <= t) sol2++;
  }
  cost = 0;
  for (i = x; i; i--) {
    cost++;
    if (s[i] == 'w') cost += b;
    st = 0;
    dr = x - 1;
    xx = t - cost - (x - i) * a;
    p = 0;
    if (xx > 0)
      while (st <= dr) {
        m = (st + dr) / 2;
        if (cost1[m] <= xx) {
          p = m;
          st = m + 1;
        } else
          dr = m - 1;
      }
    if (cost <= t) sol3 = max(sol3, x - i + 1 + p);
    cost += a;
  }
  cost = 0;
  for (i = x; i < n; i++) {
    cost++;
    if (s[i] == 'w') cost += b;
    st = 0;
    p = 0;
    dr = x - 1;
    xx = t - cost - (i - x) * a;
    if (xx > 0)
      while (st <= dr) {
        m = (st + dr) / 2;
        if (cost2[m] <= xx) {
          p = m;
          st = m + 1;
        } else
          dr = m - 1;
      }
    if (cost <= t) sol4 = max(sol4, i - x + 1 + p);
    cost += a;
  }
  cout << min(x, max(max(sol1, sol2), max(sol3, sol4)));
  return 0;
}
