#include <bits/stdc++.h>
using namespace std;
long long fron[1000000], back[1000000];
int a, n, b, ara[1000000];
int binary1(int val, int ind) {
  int ans = n + 1, mid, l = ind + 1, k = n;
  long long v;
  while (l <= k) {
    mid = (l + k) / 2;
    v = (ind - 1) * a + back[mid];
    if (v <= val) {
      ans = mid;
      k = mid - 1;
    } else
      l = mid + 1;
  }
  return ans;
}
int binary2(int val, int taken, int k) {
  int mid, l = 2, ans = 0;
  while (l <= k) {
    mid = (l + k) / 2;
    long long v = (n - mid + 1) * a + fron[mid];
    if (v <= val) {
      l = mid + 1;
      ans = mid - 1;
    } else
      k = mid - 1;
  }
  return ans;
}
char str[1000000];
int main() {
  int i, j, k, l, m, c, ma = 0, ans = 0;
  long long sum = 0;
  cin >> n >> a >> b >> c;
  cin >> str;
  for (i = 0; str[i]; i++) {
    if (str[i] == 'w') {
      ara[i + 1] = b;
    }
  }
  sum = ara[1] + 1;
  ans = 0;
  if (sum <= c) ans = 1;
  for (i = 2; i <= n; i++) {
    sum = sum + a + ara[i] + 1;
    if (sum > c) break;
    ans++;
  }
  ma = max(ans, ma);
  sum = ara[1] + 1;
  ans = 0;
  if (sum <= c) ans = 1;
  for (i = n; i >= 2; i--) {
    sum = sum + a + ara[i] + 1;
    if (sum > c) break;
    ans++;
  }
  ma = max(ans, ma);
  for (i = 2; i <= n; i++) {
    fron[i] = fron[i - 1] + a + ara[i] + 1;
  }
  for (i = n; i >= 2; i--) {
    back[i] = back[i + 1] + a + ara[i] + 1;
  }
  sum = ara[1];
  for (i = 2; i <= n && sum <= c; i++) {
    sum = fron[i] + ara[1] + 1;
    if (sum > c) break;
    l = i;
    l = i + n - (binary1(c - sum, i)) + 1;
    ma = max(ma, l);
  }
  for (i = n; i >= 2 && sum <= c; i--) {
    sum = back[i] + ara[1] + 1;
    if (sum > c) break;
    l = n - i + 1 + 1;
    l += binary2(c - sum, l - 1, i - 1);
    ma = max(ma, l);
  }
  cout << ma << endl;
}
