#include <bits/stdc++.h>
using namespace std;
using namespace std;
const int N = 500500;
int n, a, b, t;
int c[N];
char s[N];
int pref[N], suff[N];
int get(int haveTime, int maxAdd) {
  int ret = 0;
  int le = 0;
  int ri = n + 1;
  while (ri - le > 1) {
    int mid = (le + ri) >> 1;
    int idx = n - mid + 1;
    int cost = (n - idx) * a + suff[idx] + (n - idx + 1);
    if (cost <= haveTime) {
      le = mid;
    } else {
      ri = mid;
    }
  }
  ret = le;
  ret = min(ret, maxAdd);
  return ret;
}
int solve(int haveTime, int maxAdd) {
  int ret = 0;
  int le = 0;
  int ri = n + 1;
  while (ri - le > 1) {
    int mid = (le + ri) >> 1;
    int cost = (mid - 1) * a + pref[mid] + mid;
    if (cost <= haveTime) {
      le = mid;
    } else {
      ri = mid;
    }
  }
  ret = le;
  ret = min(ret, maxAdd);
  return ret;
}
int main() {
  scanf("%d%d%d%d\n", &n, &a, &b, &t);
  gets(s + 1);
  for (int i = 1; i <= n; i++) {
    if (s[i] == 'w') {
      c[i] = b;
    } else {
      c[i] = 0;
    }
  }
  pref[0] = 0;
  for (int i = 1; i <= n; i++) {
    pref[i] = pref[i - 1] + c[i];
  }
  suff[n + 1] = 0;
  for (int i = n; i >= 1; --i) {
    suff[i] = suff[i + 1] + c[i];
  }
  int result = 0;
  for (int i = 1; i <= n; i++) {
    int cost = (i - 1) * a + pref[i] + i;
    if (cost > t) break;
    cost = cost + i * a;
    result = max(result, i + get(t - cost, n - i));
  }
  int now = pref[1] + 1 + a;
  for (int i = n; i > 1; --i) {
    int cost = now + (n - i) * a + suff[i] + (n - i + 1);
    if (cost > t) break;
    cost = cost + (n - i + 1) * a;
    int taken = (n - i + 1);
    result = max(result, taken + solve(t - cost + pref[1] + 1, n - taken));
  }
  printf("%d\n", result);
  return 0;
}
