#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 123;
const int inf = 1e9 + 7;
const long long INF = 1e18 + 7;
int n, a, b, t;
char s[N];
long long cur, ans;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  scanf("%d %d %d %d\n", &n, &a, &b, &t);
  scanf("%s", s);
  for (int i = 0; i < n; i++) {
    s[i + n] = s[i];
  }
  for (long long i = 0; i < n; i++) {
    if (s[i] == 'w') cur += b;
    cur++;
    if (i) cur += a;
    if (cur <= t)
      ans = max(ans, i + 1);
    else
      break;
  }
  cur = 0;
  long long q = 0;
  for (int i = n; i >= 1; i--) {
    q++;
    if (s[i] == 'w') cur += b;
    cur++;
    if (i != n) cur += a;
    if (cur <= t)
      ans = max(ans, q);
    else
      break;
  }
  long long l = 1, r = n;
  cur = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'w') cur += b;
    cur++;
    if (i) cur += a;
  }
  while (l <= r && r < 2 * n && l < n) {
    while ((cur > t && l <= r) || (r - l + 1) > n) {
      if (s[l] == 'w') cur -= b;
      cur--;
      if (l != n) cur -= a;
      l++;
    }
    if (cur <= t && r > l) ans = max(r - l + 1, ans);
    r++;
    if (r < 2 * n) {
      if (s[r] == 'w') cur += b;
      cur++;
      if (r != n) cur += 2 * a;
    } else
      break;
  }
  l = n, r = 2 * n - 1;
  cur = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'w') cur += b;
    cur++;
    if (i) cur += a;
  }
  while (l <= r && l >= 0 && r > n) {
    while ((cur > t && l <= r) || (r - l + 1) > n) {
      if (s[r] == 'w') cur -= b;
      cur--;
      if (r != n) cur -= a;
      r--;
    }
    if (cur <= t && r > l) ans = max(r - l + 1, ans);
    l--;
    if (l >= 0) {
      if (s[l] == 'w') cur += b;
      cur++;
      if (l != 0) cur += 2 * a;
    } else
      break;
  }
  cout << ans;
}
